Forum Moderators: phranque

Message Too Old, No Replies

Possible to rewrite cookie atributes?

         

Squeak

10:26 pm on Nov 9, 2004 (gmt 0)



I have an apache instance that is doing a ProxyPass to another Apache instance that is using mod_jk internal to Tomcat.

My goal is to hide the context of the Tomcat webapp from the user.

So, if my site is:

www.foo.com

I want it to redirect to

<second apache instance>/bar (where bar is my webapp context).

I have this working great, except for the fact that my webapp sets cookies for session information, and Tomcat thinks it is in the /bar context so it sets the Path attribute equal to '/bar'

However, the browser thinks it is working with the '/' path, so it never sends back the cookie on the next request.

So my question is: Is there a way, probably via mod_rewrite, that when Tomcat sets the path of the Cookie to /bar that I can change it to /?

Thanks!

jdMorgan

5:07 am on Nov 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



squeak,

Welcome to WebmasterWorld!

I don't think you'll be able to rewrite a cookie response; mod_rewrite works on incoming HTTP requests only.

You should investigate the code used to set the cookie, and change the cookie's domain to reflect that of your front-end server.

Jim