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

session_destroy

Description

The session_destroy of Session for PHP destroys all data registered to a session.

Syntax

session_destroy(): bool

Return

Returns true on success or false on failure.

Examples

1 · void

<?

session_start();

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

$return = session_destroy();

var_export($return);

?>
true

2 · session_encode

<?

session_start();

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

session_destroy();

$data = session_encode();

var_export($data);

?>
false
HomeMenu