wood burning stoves 2.0*
The moose likes Tomcat and the fly likes Common Session  between 2 application in tomcat server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Common Session  between 2 application in tomcat server" Watch "Common Session  between 2 application in tomcat server" New topic
Author

Common Session between 2 application in tomcat server

Nithish Yalamanchili
Greenhorn

Joined: Aug 16, 2007
Posts: 24
Hai All

I have 2 web applications in tomcat server. When i login from first webapplication it goes to Index page, in that page we give a link to some action in 2nd application. what we need is common session which we cant achieve sharing common session object. Is it possible by cross context in server.xml of tomcat. If so how its possible. help me out....

Nithish
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

No, per the servlet spec, sessions are by user, by context.
In other words, each context has a separate session for each user.

There are ways to share information between contexts in Tomcat but they are not necessarily spec compliant; meaning the code may not work the same way in another container.

See:
http://wiki.apache.org/tomcat/HowTo#head-676687dc9e14f16a2dbe0e207447803a757198ac


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
Don't get me started about those stupid light bulbs.
 
subject: Common Session between 2 application in tomcat server
 
Similar Threads
Load Balancing - Handling Session between multiple servers.
Problem with referencing session information from 2 contexts, one a subfolder of another
jsp:useBean query!
Page Expired but Session is active
accessing data from other tomcat directory