tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ruth, Brice" <br...@fiskars.com>
Subject Re: disable URL rewriting for session tracking
Date Tue, 27 Jul 2004 20:58:46 GMT
Your fundamental problem is going to be that your container won't be 
able to know if a client supports cookies until the second request comes 
along. This is why on the first request, all URLs are rewritten, 
regardless of if cookies are enabled or not - the container just doesn't 
know yet.

The second request will send the cookie information back to the server, 
at which point you would know if the client supports cookies or not 
(though, I don't think there'd be anyway to distinguish a client that 
*doesn't* support cookies from a new request entirely, that would be 
tricky).

If all you want to do is disable URL rewriting, you can do that easily 
enough through a Filter. Just wrap the response in a response wrapper, 
disabling the encodeUrl methods that are in the parent class (just 
override with dummy methods).

Eric Allen wrote:

> I need to somehow disable URL rewriting for session tracking in my 
> application. My designer uses <a:href tags all over and I don't want 
> to change that, so I'm stuck with cookies. The problem is, tomcat 
> doesn't appear to have any way of saying "if the user doesn't accept 
> the session cookie, throw an exception" or something. I need a way to 
> not allow the user to login if they do not support cookies. I am using 
> Tomcat 5.0.18 and Struts 1.1. I am willing to come up with some kind 
> of work around, but I can't find a way to hook into the low-level 
> session handling stuff.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>

-- 
Brice Ruth, Sr. IT Analyst
Fiskars Brands Inc
http://www.fiskarsbrands.com/


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


Mime
View raw message