Hey all,
OMG I have just spent like 2 hours trying to work out why FireFox and Opera were not deleting my session. It worked fine in IE7, here is my original code:
session_unset();
setcookie(session_name(), '', time()-36000);
session_destroy();
Anyone see anything wrong with that? I pretty much got that out of a PHP reference book. And another PHP book told me to unset($_SESSION) while the manual says no way in hell to do that! Now here is the code that works:
session_unset();
setcookie(session_name(), '', time()-36000, '/');
session_destroy();
See it? The setcookie function needs to know the name, value, expiration and path parameters. I mean two PHP reference books got this wrong - I haven't checked my third book yet but DAMN! RTFM before you write a book :glare:
Hope this helps someone 😃