groups

name language licence
reset mysql numbers SQL (Rails) Other
gravatar php crypt PHP Other
logged in Other WA
unset session (logout) PHP WA
WA fail inline PHP Other
if readable and exsists PHP Other

< 1 2 >



language: PHP
licence: WA

unset session (logout)

options: view full snippetsend to code collector
<?php
// Initialize the session.
// If you are using session_name("something"), don't forget it now!
session_start();

// Unset all of the session variables.
$_SESSION = array();

// If it's desired to kill the session, also delete the session cookie.
// Note: This will destroy the session, and not just the session data!
if (isset($_SESSION['username'])) {
    setcookie(session_name(), '', time()-42000, '/');
}

// Finally, destroy the session.
	
(Continues...)