Welcome to WebmasterWorld Guest from 54.146.239.96

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

mod_rewrite eats my cookies!

     

TwinkleToes

6:20 pm on Jan 10, 2003 (gmt 0)

10+ Year Member



A classic tabloid headline, no?

I have a module which uses a temporary cookie to store the session ID.

The URL host/module/info shows me the current ID as a web page.

I use the following rules for mod_rewrite:

RewriteRule ^/info$ /module/info [PT,L]

RewriteRule ^/$ /module/info [PT,L]

If I browse to host/, I get the same session ID every time I refresh (good!)

If I browse to host/info, I get a _new_ session ID every time I refresh (not good!)

Is mod_rewrite screwing up or removing the cookie?
Or is the cookie dependent on the URL? If so, why does it work for the root path?

Bryan

jdMorgan

7:55 pm on Jan 10, 2003 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



TwinkleToes,

Probably an interaction with mod_dir. mod_dir provides the name of the index file if one is not specified in the URL, such as the case where domain.com/ is requested, and appends a trailing slash when the request contains only domain.com or domain.com/directory_name with no trailing slash. This is done with a redirect, but I'm not sure how it will interact with the agent (program or module, you didn't say) which issues your cookies.

Jim