struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jan T. Kim" <>
Subject Re: Session data
Date Thu, 03 Sep 2009 10:21:45 GMT
On Thu, Sep 03, 2009 at 12:59:02AM +0100, Dai Le wrote:
> Hi,
> I developed a data collection web application using struts 1.2.9 and I've
> run into a problem that I cannot find a solution to.  The amount of data
> being collected is quite a bit so pass the information along in session
> variables.  The problem arises when a user has multiple instances of the
> website opened, the session data is crossed with each other.  Because all
> the instances share the same session, it's causing the session data to be
> crossed or overwritten.  Does anyone have any ideas or thoughts on the
> matter?  Is there any way to create a new session each time the user open a
> new instance of my web application.  I've tried using URL rewriting and it
> generates new jsessionids but the clients will to have cookies disabled on
> their browser and it's not common to ask users to disable cookies on their
> browser.  Hope this makes some sense to someone, I'm having a hard
> describing the problem.  Thanks in advance.

I think that by "instances of the website" you mean distinct sessions with
the same application, in the way you might have multiple ssh clients
running on the same host and connecting to the same remote host too.

With web applications, this is not possible because your server talks
to just one browser process, which may display multiple windows (or tabs
etc.). The browser process has no concept of a web application, It only
distinguishes servers (by their FQDN); if a server has set a cookie,
the browser will include that cookie in all requests it sends to the
server, regardless of which window is involved.

It's possible in principle to keep sessions apart by generating distinct
URLs, but it's difficult (if not impossible) to use the standard session
mechanism that the container provides in this case.

Considering that users have numerous ways of creating multiple windows
to the same application (cloning windows, cutting & pasting URLs, "open
in new window" context menu items etc.), it's best to avoid trying to
create multiple sessions of a web app with one browser process, as users
will very easily lose track of which window belongs to what session.

Best regards, Jan
 +- Jan T. Kim -------------------------------------------------------+
 |             email:                                 |
 |             WWW:             |
 *-----=<  hierarchical systems are for files, not for humans  >=-----*

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message