You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Molitor, Stephen" <SM...@erac.com> on 2002/08/01 17:10:46 UTC

Multiple browser windows, different logical sessions

What's the most practical way to launch a new browser window, and have the
second window use a different session than the first?  Our prototype has a
'Open New Copy of Application' menu item that we need to implement.  The
idea is that this would pop-up a new browser window, just like using the
CNTRL-n key on IE, and that this copy of the app would be totally separate
from the first copy.  So, it would be nice if they had different sessions,
so that we wouldn't have to worry about them stomping on each other in the
shared session.

What's the best way to do this?  I understand that if we use URL rewriting
instead of cookies to keep track of the session id, then we could have
different sessions.  Can I, from the server, enforce URL rewriting instead
of cookie based session management, regardless of what the browser settings
are on the client?  And can I enforce URL rewriting in a portable, J2EE
compliant way?

Other options might include using the same session but sub-dividing it into
two halves, keyed by window id or some such.  For example:

Map myHalf = session.getAttribute("myWindowName");
Object someObject = myHalf.get("someObject");

Or, of course, one could try to avoid using the session entirely, and
persist client specific state via hidden variables, etc.

Any other approaches?  Any one have any experience with this?  Which
approach fits in best with Struts?

(Incidentally, our app is an internal web application, not designed to feel
like a browser.  We've disabled the navigation bars, and plan on using a
synchronizer token to detect if the user does things out of order via hot
keys (CNTRL-N, etc.).  The idea is that we know how they got to a given
page, and know when we can clear out part the session if they leave some
part of the app.  However, the 'Open New Copy of App' menu item kind of
blows that out of the water, if they could have two copies open on any
combination of two pages, sharing the same session.  We never really know
what part of the app they might still have open.  Also, the requirement is
really to allow n copies of the app open, not just two.)

Thanks!

Steve Molitor
smolitor@erac.com




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>