groups

name language licence
wordpress css statement CSS Other
link photoflow ActionScript Other
logged in Other WA
CSS structor CSS Other
HTML starter HTML Other
unset session (logout) PHP WA
XHTML 1.0 Transitional HTML Other
XHTML 1.0 Strict HTML Other

< 1 2 3 4 5 6 >



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...)