cookie $name = session_name(); // By default, PHPSESSID
$id = session_id(); // For example, l1jef1foi1g8u6qnui4f8b6e14
session_id('abc123');
$_SESSION = array(); // Clear session data from memory session_destroy(); // Clean up the session ID
$name = session_name(); // Get name of session cookie $expire = strtotime('-1 year'); // Create expire date in the past $params = session_get_cookie_params(); // Get session params $path = $params['path']; $domain = $params['domain']; $secure = $params['secure']; $httponly = $params['httponly']; setcookie($name, '', $expire, $path, $domain, $secure, $httponly);
session_destroy()
function.session_destroy()
function, and use the setcookie()
function to delete the session cookie.session_name()
function gets the name of the session cookie. By default, the session cookie has a name of "PHPSESSID"<./li>
session_get_cookie_params()
function gets an associative array that contains all of the parameters for the session cookie.