File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Different session for each browser window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Different session for each browser window" Watch "Different session for each browser window" New topic

Different session for each browser window

Josh Johnson

Joined: Apr 17, 2006
Posts: 4
Is this possible? I work for a call center that uses a webapp for their interface. So the reps need to have mulitple windows open, each with a different "record" in it. I originally made the app in mod_perl and developed a system that used the session from the url, unless a new window was opened (which happened when a call came in) it would grab their login information from a cookie session and then create a new session which would get placed in a hidden form element, link, etc to get passed along that window. This kept the user from having to log in all the time, but allowed them to have as many browser windows open as possible.

To make a long story short, the company underwent some structural changes and now I have a new boss who wants to redo the system in java. Can I accomplish the above-mentioned in java? I'm using an analgam of jsp/jsf/servlets on tomcat. But I figure that the underlying session-ness is still the same for all.

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63839

Hmmm, tough one. Usually the session is maintained via cookies, so any browser windows that share cookies will share the session. IE is kinda weird about it -- sometimes it does, sometimes it doesn't, depending upon how you open the browser window.

I'm not sure if URL-rewriting can help you as this is not an area I've dived off into...

In any case, I don't think that the ulitimate solution will be Tomcat-specific, so I'm going to move this on to the Servlets forum where it will get broader exposure.

[Asking smart questions] [About Bear] [Books by Bear]
Josh Johnson

Joined: Apr 17, 2006
Posts: 4
Ok, thanks.

Yeah, I'm not sure exactly where the solution to this problem lies. One way that I figured around it, is to store the user login credentials in a separate cookie. If a page is opened without proper authorization it will first try to grab the credentials from this cookie and then start a new session. I just have to figure out how to get tomcat to listen only to the urlencoded session and not to the cookie session.
I agree. Here's the link:
subject: Different session for each browser window
jQuery in Action, 3rd edition