Win a copy of Programmers Guide to Apache Thrift this week in the Open Source forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

session  RSS feed

 
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when a user access /myserver/app1/   and /myserver/app2 using two tabs of a browser window, assuming app1 and app2 are two applications  running on myserver and both of them use HttpSession.   Does server recognize the two accesses as same session ?
 
Rancher
Posts: 427
6
Fedora IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If they are different sessions then I am gonna say no.  That seems like a huge design flaw if they shared the same session.
 
Saloon Keeper
Posts: 5475
143
Android Firefox Browser Mac OS X Safari Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If they are different web apps in the Java sense of the word (meaning, each has its own WEB-INF along with all that goes with it), then the sessions are separate,
 
Bartender
Posts: 20721
124
Android Eclipse IDE Java Linux Redhat Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Moores wrote:If they are different web apps in the Java sense of the word (meaning, each has its own WEB-INF along with all that goes with it), then the sessions are separate,



Usually. You can sometimes configure webservers to share sessions between apps, but I don't recommend it.

The number of tabs/windows makes no difference for sessions. Assuming the apps don't have shared sessions configured, there will be one and only one session per webapp per browser instance, regardless of how many tabs/windows that browser has open.
 
Tim Holloway
Bartender
Posts: 20721
124
Android Eclipse IDE Java Linux Redhat Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Moores wrote:If they are different web apps in the Java sense of the word (meaning, each has its own WEB-INF along with all that goes with it), then the sessions are separate,



Oh, and you can deploy the same webapp multiple times in a webapp server, and they'll all be able to share the same WAR (including the same WEB-INF, et al.). You might actually do this, for example, if you have an app that multiple customers use and you don't want them stepping all over everyone (perhaps using different databases). It's the deployment descriptor that defines a webapp instance, not the code/internal config.

Granted, if you just dump a WAR into Tomcat's webapps folder, a default deployment descriptor will be built (or taken from the WAR's META-INF directory, if available). But still, whether explicit or implicit, the number of instances of a webapp depends on the number of deployed deployment descriptors, not the number of WARs.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!