Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

session_unset

Description

The session_unset of Session for PHP frees all session variables.

Syntax

session_unset(): bool

Return

Returns true on success or false on failure.

Examples

1 · void

<?

session_start();

$_SESSION["mykey1"] = "myvalue1";
$_SESSION["mykey2"] = "myvalue2";
$_SESSION["mykey3"] = "myvalue3";

print_r($_SESSION);

$return = session_unset();

var_export($return);
echo PHP_EOL;

print_r($_SESSION);

?>
Array
(
    [mykey1] => myvalue1
    [mykey2] => myvalue2
    [mykey3] => myvalue3
)
true
Array
(
)
HomeMenu