delete_cookie() |
[eluser]ci_user[/eluser]
I'm trying to delete cookies on logout without success... any suggestions? My code is: Code: function logout(){
[eluser]InsiteFX[/eluser]
To delete a cookie the time has to be in the pass the cookie helper does not set an expire time. You can use this which should work Code: // set the expiration date to - the cookie time
[eluser]ci_user[/eluser]
I tried both without success. I thought set_cookie creates a cookie, not updates an existing cookie? Code: setcookie('csrf_cookie_security', '', time()-31500000); Also tried this which I believe is the CI way to set a cookie. Code: set_cookie('csrf_cookie_security', '', time()-31500000); Neither one deleted the cookie... It is frustrating that delete_cookie() won't work if there is no expiration set.
[eluser]Kraig[/eluser]
[quote author="InsiteFX" date="1340816949"]Setcookie is used for all of the cookies methods the difference is in the time see the -31500000 A cookie is deleted when the time has expired so by setting the time()-31500000 sets the cookie to expired. Which deletes it. W3Schools setcookie PHP net setcookie [/quote] I have tried what you said and when I try to logout the cookie's life doesn't get adjusted. Any ideas? Code: // set the expiration date to - the cookie time
[eluser]Kraig[/eluser]
Answered my own question....all I had to do was set $config['cookie_domain'] = ".www.yoursite.com";
[eluser]InsiteFX[/eluser]
lol i was just going to ask you if you had set it... |
Welcome Guest, Not a member yet? Register Sign In |