Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.