You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by kohanm <ko...@gmail.com> on 2008/08/19 08:03:16 UTC

How to transfer session to another browser

Hi,
I have Tomcat 5.5 installed and a Java web applicaion is running.
How could*  *I *se*t up Tomcat that if I copy and past the URL of the web
application to anoather browser the session could be tranferred to the new
browser, in other words:
 Session can be transferred to another browser by copying and pasting the
URL.

MK

Re: How to transfer session to another browser

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jens,

Jens Kapitza wrote:
> i think if you really will do this you can
> 
>  make a warper to the session object in the tomcat app. and store all
> the data in the database (select by the ip,username or id) - you have to
> pass this as parameter - (or en(/de)code your url in other way)
> ?id=$$BLABLA$$

... or just use the standard ';jsessionid=$$BLABLA$$$' that is built
into every servlet container. The trouble is that you have tun rin all
your URLs through HttpServletResponse.encodeURL.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkitl4AACgkQ9CaO5/Lv0PDmpQCgmDVs1MFstexD/kl4qaGhSov7
XrQAnjIPNY78DDFk/EghCr6jVE4CFRb3
=j2rT
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to transfer session to another browser

Posted by Jens Kapitza <j....@schwarze-allianz.de>.
i think if you really will do this you can

  make a warper to the session object in the tomcat app. and store all 
the data in the database (select by the ip,username or id) - you have to 
pass this as parameter - (or en(/de)code your url in other way) 
?id=$$BLABLA$$

---
Jens Kapitza

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to transfer session to another browser

Posted by m....@inbox-online.com.
> Hi,
>
> If I add   cookie="false" in Context, it's geting worse and the session in
> the original browser does not work properly.
> In my program to keep track of data I use a  JavaBean and then pass in
> session like:
>
> session.setAttribute("appBean" , Mybean);
> The  appBean session should be accessible when I copy web application's
> URL
> and past it to the new browser.
>
> How can I do that?
>
> Thanks for any help.
>
>
> MK
>
>
> On 8/19/08, Christian Poecher <ch...@mailinator.com> wrote:
>>
>>
>>
>>
>> kohanm wrote:
>> >
>> > Hi,
>> > I have Tomcat 5.5 installed and a Java web applicaion is running.
>> > How could*  *I *se*t up Tomcat that if I copy and past the URL of the
>> web
>> > application to anoather browser the session could be tranferred to the
>> new
>> > browser, in other words:
>> >  Session can be transferred to another browser by copying and pasting
>> the
>> > URL.
>> >
>>
>> Try setting cookies to false. The documentation for that feature is
>> here:
>> http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
>>
>> Regards,
>> Chris
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-transfer-session-to-another-browser-tp19044768p19045406.html
>> Sent from the Tomcat - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
>
> --
> Massoud
>

You are trying to do something that is not intended to be supported by
browsers...

I think that you can't do that...


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to transfer session to another browser

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Massoud,

kohanm wrote:
> If I add   cookie="false" in Context, it's geting worse and the session in
> the original browser does not work properly.

It sounds like you have not coded your webapp properly, then. If you
had, disabling cookies would have worked just fine.

> In my program to keep track of data I use a  JavaBean and then pass in
> session like:
> 
> session.setAttribute("appBean" , Mybean);
>
> The appBean session should be accessible when I copy web application's URL
> and past it to the new browser.
> 
> How can I do that?

Unless you can find a way to transfer a cookie from one browser to
another, you cannot do this.

If you were to use URL rewriting instead, then the session would easily
transfer. As you have not properly formatted all your URLs (see above),
you will have to go back and do this in order to achieve your goal.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkitlogACgkQ9CaO5/Lv0PCc0wCeKlRuSIt1vyKVIO5cDZrv3i5D
+WAAn2NB2aiYzXJXw8K/9llL4rco22eR
=SPm7
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to transfer session to another browser

Posted by kohanm <ko...@gmail.com>.
Hi,

If I add   cookie="false" in Context, it's geting worse and the session in
the original browser does not work properly.
In my program to keep track of data I use a  JavaBean and then pass in
session like:

session.setAttribute("appBean" , Mybean);
The  appBean session should be accessible when I copy web application's URL
and past it to the new browser.

How can I do that?

Thanks for any help.


MK


On 8/19/08, Christian Poecher <ch...@mailinator.com> wrote:
>
>
>
>
> kohanm wrote:
> >
> > Hi,
> > I have Tomcat 5.5 installed and a Java web applicaion is running.
> > How could*  *I *se*t up Tomcat that if I copy and past the URL of the web
> > application to anoather browser the session could be tranferred to the
> new
> > browser, in other words:
> >  Session can be transferred to another browser by copying and pasting the
> > URL.
> >
>
> Try setting cookies to false. The documentation for that feature is here:
> http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
>
> Regards,
> Chris
> --
> View this message in context:
> http://www.nabble.com/How-to-transfer-session-to-another-browser-tp19044768p19045406.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Massoud

Re: How to transfer session to another browser

Posted by Christian Poecher <ch...@mailinator.com>.


kohanm wrote:
> 
> Hi,
> I have Tomcat 5.5 installed and a Java web applicaion is running.
> How could*  *I *se*t up Tomcat that if I copy and past the URL of the web
> application to anoather browser the session could be tranferred to the new
> browser, in other words:
>  Session can be transferred to another browser by copying and pasting the
> URL.
> 

Try setting cookies to false. The documentation for that feature is here:
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

Regards,
Chris
-- 
View this message in context: http://www.nabble.com/How-to-transfer-session-to-another-browser-tp19044768p19045406.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org