
December 19th, 2012, 11:17 PM
|
|
Contributing User
|
|
Join Date: Dec 2012
Location: Ithaca
Posts: 64
Time spent in forums: 13 h 7 m 48 sec
Reputation Power: 1
|
|
|
PHP-General - How to set and unset cookie for a site with url rewrite?
Well on my site the url rewrite has been working like a charm, but right now I am encountering a big problem. I am unable to log out after logging in, which never happened before with the old system. The url for login and logout looks like these:
PHP Code:
www.domain.com/scriptpath/login
www.domain.com/scriptpath/login/logout
So yeah, both of them are in the same script file/controller. Login is the default/index action, while logout is a secondary operation.
The problem is that when I unset cookies with setcookie("cookie", "", time() - 3600), it only unset cookies for the pseudo-directory /login, but not for the entire domain and scriptpath. For this reason I appear to be logged out while visiting the login/logout page, but at anywhere else I am still logged in. There's nothing I can do about it...
So anyone of you familiar with url rewrite? Can you please help me fix this weird issue? And if I may ask, what do you do with your own login/logout system under url rewrite?
|