| N Rohler 2004-08-04, 7:15 pm |
| Just a tip...when removing cookies, use time()-86400 or more, so that if the
user is in a different time zone than the server the cookie will still be
removed.
Here's a script from php.net that should remove the session cookies. You also
need to use session_destroy after session_unset.
session_start();
$CookieInfo = session_get_cookie_params();
if ( (empty($CookieInfo['domain'])) && (empty($CookieInfo['secure'])) ) {
setcookie(session_name(), '', time()-3600, $CookieInfo['path']);
} elseif (empty($CookieInfo['secure'])) {
setcookie(session_name(), '', time()-3600, $CookieInfo['path'],
$CookieInfo['domain']);
} else {
setcookie(session_name(), '', time()-3600, $CookieInfo['path'],
$CookieInfo['domain'], $CookieInfo['secure']);
}
unset($_COOKIE[session_name()]);
session_unset();
session_destroy();
|