aspose file tools*
The moose likes Servlets and the fly likes Losing session between different web apps. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Losing session between different web apps." Watch "Losing session between different web apps." New topic
Author

Losing session between different web apps.

Alaa Abutabaq
Greenhorn

Joined: Jan 15, 2002
Posts: 18
Hi,
I'm facing a problem in tracking session between different webapps. When i request from a page in a web app to a page in a diff web app, I lose the session.I use Sun one web server 6.1. Is there a way to keep tracking sessions between web apps?
Thanks in advance
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

When you say "web app", I assume you mean a separate web context and not a single context on separate machines?

If you are, then sessions don't work that way. A session is specific to an application context, and while the session ID in some containers may be the same between contexts, the session itself is not. It is possible to create messages between web applications, but you may find it better to have a 'common area' such as shared Database or business tier to allow the applications to communicate.

Be careful that you don't try to replicate the session's responsibility though. Doing so is dangerous since it may not be completely compatible with the existing session mananger and prevent clustering, or it may cause the original session manager to become unstable.

I hope this helps.
Dave
Alaa Abutabaq
Greenhorn

Joined: Jan 15, 2002
Posts: 18
Thanks very much for your help. I think about that, but i wished if i have a way to use the same session. It seems there is no way.
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
There are very good reasons why you can't, security being prime among them.


42
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Losing session between different web apps.
 
Similar Threads
Session tracking in client-server model ?
passing information between servlets
Share session between web apps
How can i share the session between webapps?
About sending session ID