Here is a great, lightweight script that’s great for logging a user out of a password protected site. It deletes the cookie too…
// Delete Sessions
$_SESSION = array();
if (isset($_COOKIE[session_name()])) {
setcookie(session_name(), '', time()-42000, '/');
}
session_destroy();
Taken from php.net
Main Category