Property | Type | Description | |
---|---|---|---|
$_engine | SessionHandlerInterface | The Session handler instance used as an engine for persisting the session data. | |
$_isCLI | boolean | Whether this session is running under a CLI environment | |
$_lifetime | integer | The time in seconds the session will be valid for | |
$_started | boolean | Indicates whether the sessions has already started |
Method | Description | |
---|---|---|
__construct ( array $config = [] ) | Constructor. | |
check ( string | null $name = null ) : boolean | Returns true if given variable name is set in session. | |
clear ( boolean $renew = false ) : void | Clears the session. | |
consume ( string $name ) : mixed | Reads and deletes a variable from session. | |
create ( array $sessionConfig = [] ) : |
Returns a new instance of a session after building a configuration bundle for it. | |
delete ( string $name ) : void | Removes a variable from session. | |
destroy ( ) : void | Helper method to destroy invalid sessions. | |
engine ( string | SessionHandlerInterface | null $class = null, array $options = [] ) : SessionHandlerInterface | null | Sets the session handler instance to use for this session. | |
id ( string | null $id = null ) : string | Returns the session id. | |
options ( array $options ) : void | Calls ini_set for each of the keys in $options and set them to the respective value in the passed array. | |
read ( string | null $name = null ) : string | null | Returns given session variable, or all of them, if no parameters given. | |
renew ( ) : void | Restarts this session. | |
start ( ) : boolean | Starts the Session. | |
started ( ) : boolean | Determine if Session has already been started. | |
write ( string | array $name, mixed $value = null ) : void | Writes value to given session variable name. |
Method | Description | |
---|---|---|
_defaultConfig ( string $name ) : boolean | array | Get one of the prebaked default session configurations. | |
_hasSession ( ) : boolean | Returns whether a session exists | |
_overwrite ( array &$old, array $new ) : void | Used to write new data to _SESSION, since PHP doesn't like us setting the _SESSION var itself. | |
_timedOut ( ) : boolean | Returns true if the session is no longer valid because the last time it was accessed was after the configured timeout. |
public __construct ( array $config = [] ) | ||
$config | array | The Configuration to apply to this session object |
protected _hasSession ( ) : boolean | ||
return | boolean |
public engine ( string | SessionHandlerInterface | null $class = null, array $options = [] ) : SessionHandlerInterface | null | ||
$class | string | SessionHandlerInterface | null | The session handler to use |
$options | array | the options to pass to the SessionHandler constructor |
return | SessionHandlerInterface | null |
protected SessionHandlerInterface $_engine | ||
return | SessionHandlerInterface |
protected bool $_isCLI | ||
return | boolean |
protected int $_lifetime | ||
return | integer |
protected bool $_started | ||
return | boolean |