You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by er...@pch.gc.ca on 2008/07/22 20:07:35 UTC
Session sharing between two URLs
Hi all,
I'm wondering if there is a way to configure Tomcat to share session
between two URLs from the same webapp? I have an application with
billingual URLs and when users toggle between the languages the session
passed (using jsessionid) does not contain log in information and the user
is required to log into the application again. I have found a way to
change the Tomcat source code to allow this, or to store session date in a
context but I would like to know if it can be done another way? or has
there been a feature request for this function? Thank you!
Erica
RE: Session sharing between two URLs
Posted by er...@pch.gc.ca.
Unfortunately, I set cookies = "false" and emptySessionPath="true" and
only pass the jsessionid to the URL, but it did not work. I found this
how-to about passing context data:
http://www.fwd.at/tomcat/sharing-session-data-howto.html
But this is the case where two different webapps are sharing the same user
data, but I actually only have one webapp, one context, with two different
URLs from the DNS pointing to it, so I'm wondering if this will work? or
is there another way of doing it?
Erica
"Caldarale, Charles R" <Ch...@unisys.com>
22/07/2008 04:37 PM
Please respond to
"Tomcat Users List" <us...@tomcat.apache.org>
To
Tomcat Users List <us...@tomcat.apache.org>
cc
Subject
RE: Session sharing between two URLs
> From: erica_ren@pch.gc.ca [mailto:erica_ren@pch.gc.ca]
> Subject: RE: Session sharing between two URLs
>
> I simply want a way to be able to switch between English
> and French URLs with the same jsessionid.
O.k., this sounds like it's really a cookie problem, rather than one where
you're appending JSESSIONID to the URL. You might try setting
cookies="false" in the <Context> element for your webapp to see if that
helps. Look here for reference:
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html#Attributes
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.
---------------------------------------------------------------------
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: Session sharing between two URLs
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: erica_ren@pch.gc.ca [mailto:erica_ren@pch.gc.ca]
> Subject: RE: Session sharing between two URLs
>
> I simply want a way to be able to switch between English
> and French URLs with the same jsessionid.
O.k., this sounds like it's really a cookie problem, rather than one where you're appending JSESSIONID to the URL. You might try setting cookies="false" in the <Context> element for your webapp to see if that helps. Look here for reference:
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html#Attributes
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
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: Session sharing between two URLs
Posted by er...@pch.gc.ca.
Thank you Chuck! I'm using Tomcat 5.5.25, and we are using our own
authentication system so Single Sign On Vale cannot be used. I set
emptySessionPath="true" to make the path on the jsessionid cookie less
restrictive.
I'm using both URLs www.domain1.com and www.domain2.com to access the same
webapp, these two DNS entries point to the same Tomcat instance. The
application automatically switches user locale based on the language
switch, and hence changing the URL displayed. JSESSIONID is used to track
user information and is appended as a URL parameter. I simply want a way
to be able to switch between English and French URLs with the same
jsessionid. I don't know if this is possible without changing the Tomcat
source code?
Erica
"Caldarale, Charles R" <Ch...@unisys.com>
22/07/2008 03:20 PM
Please respond to
"Tomcat Users List" <us...@tomcat.apache.org>
To
Tomcat Users List <us...@tomcat.apache.org>
cc
Subject
RE: Session sharing between two URLs
> From: erica_ren@pch.gc.ca [mailto:erica_ren@pch.gc.ca]
> Subject: Session sharing between two URLs
>
> I'm wondering if there is a way to configure Tomcat to share
> session between two URLs from the same webapp?
Are you sure both URLs access the same webapp? Or do you really have the
webapp deployed twice, once for each language? If the latter, the
SingleSignOn valve may help:
http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#Single%20Sign%20On%20Valve
Next time, tell us the Tomcat version you're using.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.
---------------------------------------------------------------------
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: Session sharing between two URLs
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: erica_ren@pch.gc.ca [mailto:erica_ren@pch.gc.ca]
> Subject: Session sharing between two URLs
>
> I'm wondering if there is a way to configure Tomcat to share
> session between two URLs from the same webapp?
Are you sure both URLs access the same webapp? Or do you really have the webapp deployed twice, once for each language? If the latter, the SingleSignOn valve may help:
http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#Single%20Sign%20On%20Valve
Next time, tell us the Tomcat version you're using.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
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