session_status
Description
The session_status of Session for PHP returns the current session status.
Syntax
session_status(): int
Return
Returns:
Value | Constant | Description |
---|---|---|
0 | PHP_SESSION_DISABLED | sessions are disabled |
1 | PHP_SESSION_NONE | sessions are enabled, but none exists |
2 | PHP_SESSION_ACTIVE | sessions 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
Links
Session
- session_abort
- session_cache_expire
- session_cache_limiter
- session_commit
- session_create_id
- session_decode
- session_destroy
- session_encode
- session_gc
- session_get_cookie_params
- session_id
- session_module_name
- session_name
- session_regenerate_id
- session_register_shutdown
- session_reset
- session_save_path
- session_set_cookie_params
- session_set_save_handler
- session_start
- session_unset
- session_write_close