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

session_status

Description

The session_status of Session for PHP returns the current session status.

Syntax

session_status(): int

Return

Returns:

ValueConstantDescription
0PHP_SESSION_DISABLEDsessions are disabled
1PHP_SESSION_NONEsessions are enabled, but none exists
2PHP_SESSION_ACTIVEsessions are enabled, and one exists

Examples

1 · void

<?

$return = session_status();

echo $return;

?>
1

2 · return · PHP_SESSION_NONE

<?

$return = session_status();

echo $return;

?>
1

3 · return · PHP_SESSION_ACTIVE

<?

session_start();

$return = session_status();

echo $return;

?>
2
HomeMenu