You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by og...@yahoo.com on 2005/11/13 23:56:09 UTC

[users@httpd] URL rewriting and cookie paths (rewritable?); loss of session information

Hello,

I'm using httpd 1.3.34 with mod_rewrite and am having problems with
cookies.

- Before URL rewriting:
My application generates a cookie with a path (e.g. /myapp).  This
works fine when there is no URL rewriting, and when all URLs to my
application have /myapp in the path (e.g. http://..../myapp/page1 or
http://..../myapp/page2).

- After URL rewriting:
I am rewriting URLs from /myapp/User?id=johnny (real URL) to
/user/johnny (what users see in the browser).
When a URL is rewritten, there is no '/myapp' any more, and my cookies
don't get sent (from browser to the server), since the paths don't
match.  Since these cookies hold my session information (think
jsessionid=34tgy74848 type of stuff), my session information gets lost.


I think the problem would be solved if mod_rewriting also rewrote
Cookie paths.  If this is the original cookie (Set-Cookie HTTP response
header):

  Set-Cookie: JSESSIONID=1ftmqr67vvnld;Path=/myapp

I would love to be able to tell mod_rewrite to rewrite '/myapp'
_cookie_ path to, say, just '/'.


- Questions:
Is this doable (in 1.3.*)?
Is this doable in 2.0.*?

Any help would be veeeeeeeeeeeeeery appreciated.

Thank you,
Otis

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Simpy -- http://www.simpy.com/ -- Find it. Tag it. Share it.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org