You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Azudio <az...@hotmail.com> on 2004/12/11 16:22:07 UTC

Newb: Separate sessions in two browser windows

Hi all,
Firstly apols for my ignorance as I'm new to Java & Tapestry.
Is it possible to have a Tapestry application that maintains a seperate 
session for each new connection. I've knocked up a small app with a 
login form followed by a welcome page which is using my Visit object. 
So if I log in as 'joe' my Visit instance contains 'name' = joe, when I 
open a new window and log in as 'ad' and then do a refresh of the 'joe' 
welcome I get 'ad' where 'joe' should be. The session ID's are the 
same.

I'm obviously missing something but I'm finding it tricky to work out 
where I'm going wrong.

Thanks.

Adam Henderson



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Newb: Separate sessions in two browser windows

Posted by Jonathan Millett <jo...@millett.net>.
Azudio wrote:

> Is it possible to have a Tapestry application that maintains a 
> seperate session for each new connection. I've knocked up a small app 
> with a login form followed by a welcome page which is using my Visit 
> object. So if I log in as 'joe' my Visit instance contains 'name' = 
> joe, when I open a new window and log in as 'ad' and then do a refresh 
> of the 'joe' welcome I get 'ad' where 'joe' should be. The session 
> ID's are the same.
>
> I'm obviously missing something but I'm finding it tricky to work out 
> where I'm going wrong.

You're not going wrong at all. That's just how it works :-)

Read up on sessions in the servlet specification: 
http://java.sun.com/products/servlet/download.html.
The short answer is that the session id is being stored in a cookie 
which all browser windows share. This is the normal mode of operation. 
If you really do need to have different sessions in different windows, 
you could configure your servlet container to pass the session id as a 
url parameter instead of as a cookie. The container will normally do 
this automatically if your browser has cookies disabled.

Jon

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Separate sessions in two browser windows

Posted by Bryan Lewis <br...@maine.rr.com>.
If you open a new window on the current session -- by pressing Ctrl-N in
Internet Explorer, for example -- that's what happens.  I've never heard of
a way around it, other than not telling users about Ctrl-N. :-)

If you start an entirely new window (like from the Start Menu), it doesn't
happen.


----- Original Message ----- 
From: "Azudio" <az...@hotmail.com>
To: <ta...@jakarta.apache.org>
Sent: Saturday, December 11, 2004 10:22 AM
Subject: Newb: Separate sessions in two browser windows


> Hi all,
> Firstly apols for my ignorance as I'm new to Java & Tapestry.
> Is it possible to have a Tapestry application that maintains a seperate
> session for each new connection. I've knocked up a small app with a
> login form followed by a welcome page which is using my Visit object.
> So if I log in as 'joe' my Visit instance contains 'name' = joe, when I
> open a new window and log in as 'ad' and then do a refresh of the 'joe'
> welcome I get 'ad' where 'joe' should be. The session ID's are the
> same.
>
> I'm obviously missing something but I'm finding it tricky to work out
> where I'm going wrong.
>
> Thanks.
>
> Adam Henderson
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org