Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

495
Views
How to run two spring boot applications on same server?

I have two Spring Boot applications. I want them to run on different ports at the same time on the server, right now I'm testing it locally on my computer and when I run both jars and I'm using one application, the other one would refresh and logout. I can't use both applications at the same time.

Is this a problem with the embedded server, spring boot or something else? I've read a couple of articles but I'm not sure why is this or how to solve this in the best way. Should I package both apps as WAR and run them using Apache Tomcat, or is there a newest way to do this with spring boot and the jar packaging?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

The sessions are based on cookie and the cookie is saved based on the name and the hostname. For example if you are running two spring boot or tomcat applications and try to connect on these 2 applications:

  • For the first application (running in localhost:8080), a session is created with by default a name JSESSIONID and the host localhost
  • For the second application (running in localhost:8090), a session is created with by default a name JSESSIONID and the host localhost and will invalidate the first application.

You can:

  • change the url (for example app1:8080 and app2:8090).
  • Change the session cookie name which depends on your architecture/server. For Spring Boot, you can change it this way: server.servlet.session.cookie.name = ANOTHERSESSIONID
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!