johnny042 Posted January 4, 2010 Share Posted January 4, 2010 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 htaccess: Options RewriteEngine on RewriteRule file/login/(.*) /file/login.php$1 [L] Quote Link to comment https://forums.phpfreaks.com/topic/187188-cookies-modrewrite/ Share on other sites More sharing options...
cags Posted January 5, 2010 Share Posted January 5, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/187188-cookies-modrewrite/#findComment-988706 Share on other sites More sharing options...
johnny042 Posted January 5, 2010 Author Share Posted January 5, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/187188-cookies-modrewrite/#findComment-988942 Share on other sites More sharing options...
cags Posted January 5, 2010 Share Posted January 5, 2010 Are you sure it's actually getting to the right section of code. Have you tried adding a die statement in so you can ensure it's getting into the right block? Quote Link to comment https://forums.phpfreaks.com/topic/187188-cookies-modrewrite/#findComment-988944 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.