The session class provides several static methods for session handling.
The session class provides several static methods for session handling.
These methods will setup and teardown user sessions.
static init($name, $timeout=null) [static] ¶Initialize the session with the given name.
$nameThe name this session should have.
$timeoutThe timeout value for this session.
static destroy() [static] ¶Destroy the current session.
These methods can be used to get and set session data.
static set($name, $value) [static] ¶Store a variable in the session.
$nameThe variable name.
$valueThe value of the variable.
static get($name) [static] ¶Obtain a value from the session.
If no value was set for the provided name, an error is thrown.
$nameThe variable name.
The value of the variable.
static delete($name) [static] ¶Deletes a variable from the session.
If no value was set for the provided name, an error is thrown.
$nameThe name of the variable to delete.
The value of deleted variable.
static is_set($name) [static] ¶Checks if a variable is defined in the session.
$nameThe variable name to check for.
True if the variable is available, false otherwise.