You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Tony Chan <ju...@hotmail.com> on 2005/01/25 20:48:07 UTC

Tomcat and Sesssion question

Hi,

Does anyone know if there is any setting in tomcat 5 that I can use to 
always attach JSESSIONID to all links in a webapp? Also, is there any way to 
change the name (from JSESSIONID to sth else)?

Thanks a lot!
Tony



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


RE: Tomcat and Sesssion question

Posted by Mike Curwen <g_...@globallyboundless.com>.
Yes, you would still have needed to send your links through one of :

HttpServletResponse.encodeURL()
or
HttpServletResponse.encodeRedirectURL()
 
(which is a fairly good practice anyways).


Your other option is to spend a bunch of time coding a javax.servlet.Filter
that wraps the response, then parses through the response, and re-writes the
links for you. iPlanet (yes, I'm an iPlanet survivor) was able to do this
long before Filters, with mixed success.


Mike Curwen


> -----Original Message-----
> From: Tony Chan [mailto:jumptiger@hotmail.com] 
> Sent: Tuesday, January 25, 2005 5:09 PM
> To: 'Tomcat Users List'
> Subject: RE: Tomcat and Sesssion question
> 
> 
> Thanks for your reply.
> 
> The situation is that we have an application already written. 
> However, for technical reasons, we need session ID to be 
> attached to all links within the application. Instead of 
> going to every file and making modifications, I am looking 
> into the possibility of doing that by changing Tomcat 
> configurations. You have provided an excellent solution but 
> the application will still have to be modified on so that all 
> URLs are encoded. Am I correct?
> 
> Thanks again!
> 
> Tony
> 
> -----Original Message-----
> From: Jukka Uusisalo [mailto:jukka.uusisalo@dnainternet.net] 
> Sent: Tuesday, January 25, 2005 12:23 PM
> To: Tomcat Users List
> Subject: Re: Tomcat and Sesssion question
> 
> Tony Chan wrote:
> > Hi,
> > 
> > Does anyone know if there is any setting in tomcat 5 that I 
> can use to
> > always attach JSESSIONID to all links in a webapp? Also, is 
> there any 
> > way to change the name (from JSESSIONID to sth else)?
> > 
> 
> If you set context element cookies attribute in server.xml to false
> ,so using cookies for session identify is disabled and url-rewriting
> will be used allways. Is this what want to do by attaching 
> jsessionid to 
> all your links?
> 
> See 
> http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html
> 
> Name 'jsessionid' is spesified by servlet specs.
> 
> - Jukka -
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 


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


RE: Tomcat and Sesssion question

Posted by Tony Chan <ju...@hotmail.com>.
Thanks for your reply.

The situation is that we have an application already written. However, for
technical reasons, we need session ID to be attached to all links within the
application. Instead of going to every file and making modifications, I am
looking into the possibility of doing that by changing Tomcat
configurations. You have provided an excellent solution but the application
will still have to be modified on so that all URLs are encoded. Am I
correct?

Thanks again!

Tony

-----Original Message-----
From: Jukka Uusisalo [mailto:jukka.uusisalo@dnainternet.net] 
Sent: Tuesday, January 25, 2005 12:23 PM
To: Tomcat Users List
Subject: Re: Tomcat and Sesssion question

Tony Chan wrote:
> Hi,
> 
> Does anyone know if there is any setting in tomcat 5 that I can use to 
> always attach JSESSIONID to all links in a webapp? Also, is there any 
> way to change the name (from JSESSIONID to sth else)?
> 

If you set context element cookies attribute in server.xml to false
,so using cookies for session identify is disabled and url-rewriting
will be used allways. Is this what want to do by attaching jsessionid to 
all your links?

See http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html

Name 'jsessionid' is spesified by servlet specs.

- Jukka -

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


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


Re: Tomcat and Sesssion question

Posted by Jukka Uusisalo <ju...@dnainternet.net>.
Tony Chan wrote:
> Hi,
> 
> Does anyone know if there is any setting in tomcat 5 that I can use to 
> always attach JSESSIONID to all links in a webapp? Also, is there any 
> way to change the name (from JSESSIONID to sth else)?
> 

If you set context element cookies attribute in server.xml to false
,so using cookies for session identify is disabled and url-rewriting
will be used allways. Is this what want to do by attaching jsessionid to 
all your links?

See http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html

Name 'jsessionid' is spesified by servlet specs.

- Jukka -

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