Jump to content

Cookies & Modrewrite?


johnny042

Recommended Posts

Hello everyone, this is my first post on this forum.

 

I recently ran into a bug when it comes to ending a cookie session. 

 

Link A points to domain.com/file/login/?do=logout&sess=G2LRoEFkSgBklgk

When I click link A it takes me to the logout page but does not end the session. 

 

Now, link B points to domain.com/file/login.php?do=logout&sess=G2LRoEFkSgBklgk

When I click link B it also takes me to the logout page and also ends the session.

 

So basically my problem is that when using the rewritten link I cannot end my session cookie.  Any pointers anyone??  Thanks.

 

By the way, I'm a total n0ob when it comes to mod rewrite so I might not even have the correct rewrite rule  :shrug:

 

htaccess:

Options 
RewriteEngine on
RewriteRule file/login/(.*) /file/login.php$1 [L]

Link to comment
https://forums.phpfreaks.com/topic/187188-cookies-modrewrite/
Share on other sites

The section of the URL after the question mark is the query string, as such I don't believe it is matched in the RewriteRule pattern. What this means is that your (.*) will never actually match anything. For this reason your pattern might aswell be...

 

RewriteRule ^file/login/$ /file/login.php [L]

 

That being said I can't really see why your code wouldn't work.

Link to comment
https://forums.phpfreaks.com/topic/187188-cookies-modrewrite/#findComment-988706
Share on other sites

The section of the URL after the question mark is the query string, as such I don't believe it is matched in the RewriteRule pattern. What this means is that your (.*) will never actually match anything. For this reason your pattern might aswell be...

 

RewriteRule ^file/login/$ /file/login.php [L]

 

That being said I can't really see why your code wouldn't work.

 

Thanks for the suggestion on the rewrite rule, i made that change just in case and still cant end the session using the rewrite rule.  Again thanks for the tip.

Link to comment
https://forums.phpfreaks.com/topic/187188-cookies-modrewrite/#findComment-988942
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.