Browser and HttpSession Object

T

Tim

How can I force my webapp to create a new session for every new
browser-window?

tia.
 
?

=?iso-8859-1?q?Roger_Lindsj=F6?=

How can I force my webapp to create a new session for every new
browser-window?

I don't think you have control over this when using cookies. Most
browsers don't see different windows as different sessions. However, with
url rewriting (session id's in the URI) I think you can make it work.

Roger Lindsjö
 
J

John C. Bollinger

Roger said:
I don't think you have control over this when using cookies. Most
browsers don't see different windows as different sessions. However, with
url rewriting (session id's in the URI) I think you can make it work.

On the other hand, it may be difficult to prevent your servlet container
from managing sessions via cookies when it can, and it is unwise to
postulate implementing different behavior for different session tracking
mechanisms. The approach most people take is simply to take into
account that there may be multiple browser windows open on the same
session at the same time. It is usually better to make your application
more flexible and robust than to attempt to force its environment and
clients to cater to its limitations and foibles.


John Bollinger
(e-mail address removed)
 
S

Steve Claflin

John C. Bollinger said:
On the other hand, it may be difficult to prevent your servlet container
from managing sessions via cookies when it can, and it is unwise to
postulate implementing different behavior for different session tracking
mechanisms. The approach most people take is simply to take into
account that there may be multiple browser windows open on the same
session at the same time. It is usually better to make your application
more flexible and robust than to attempt to force its environment and
clients to cater to its limitations and foibles.

John Bollinger
(e-mail address removed)

But, you could view the problem as having sessions and "sub-sessions"
and write your own mechanism for handling the sub-session by manually
rewriting the urls with your own sub-session id. I don't know if you
could make use of the existing HttpSession class to do that, though, but
you may not need the complete functionality of that class anyway.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top