Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to share tomcat sessions across multiple IE windows

4 views
Skip to first unread message

Adam Lipscombe

unread,
Oct 10, 2007, 5:00:20 AM10/10/07
to
Folks,


My app spawns another window to display help, via the window.open() javascript call.

The new window does not share the same session as the original, the session ID is always different.
Occasionally the ID of the new window is that of a session that has expired so the help does not
display.


I think his behaviour is IE specific, I found a couple of (non tomcat) explanations here:

http://classicasp.aspfaq.com/general/how-do-i-manage-a-session-across-multiple-windows.html.
http://de3.php.net/session-start

In the latter it says:
"The problem is that IE doesn't always use the same IE process to host a new pop-up window - it
chooses one (using some mysterious strategy) from the pool of running IE processes! Since session
information (cookies) is not preserved across processes, the pop-up may loose the session (and
probably redirect the user to your log-in page.)"


Does anyone know how to make the new window use the same session as the original window?
Or at least use a brand-new session rather than a recycled old one?


TIA - Adam

Kevin Dean [TeamB]

unread,
Oct 10, 2007, 10:29:36 AM10/10/07
to
Adam Lipscombe wrote:

>My app spawns another window to display help, via the window.open()
>javascript call.
>
>The new window does not share the same session as the original, the
>session ID is always different.
>Occasionally the ID of the new window is that of a session that has
>expired so the help does not display.

That's probably because it's reusing a process that has an old session ID.

>I think his behaviour is IE specific, I found a couple of (non tomcat)
>explanations here:
>
>http://classicasp.aspfaq.com/general/how-do-i-manage-a-session-across-multiple-windows.html.
>http://de3.php.net/session-start

Ouch. That looks ugly, but it makes sense that this would be the cause of
your problem.

>Does anyone know how to make the new window use the same session as the
>original window?
>Or at least use a brand-new session rather than a recycled old one?

Try this. Instead of:

window.open("help_index.jsp");

Use:

window.open("help_index.jsp", "W8709667");

What this does is open a window with a specific name. If the named window
doesn't exist, it is (probably) created within the process of the calling
window, so it should share the same session ID.

To have multiple versions of your application running at the same time,
you need to make sure that the window name is unique, otherwise you'll end
up with multiple sessions all sharing the same help window. You can build
the window name as:

windowName = "W" + request.getSession().getId();

I haven't tried this, but this is my best guess for getting around this
problem.

--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
http://www.datadevelopment.com/

Please see Borland's newsgroup guidelines at
http://info.borland.com/newsgroups/guide.html

0 new messages