PHP Class Symfony\Component\HttpFoundation\SessionStorage\NativeSessionStorage

Author: Fabien Potencier ([email protected])
Inheritance: implements Symfony\Component\HttpFoundation\SessionStorage\SessionStorageInterface
Show file Open project: pmjones/php-framework-benchmarks Class Usage Examples

Protected Properties

Property Type Description
$options
$sessionIdRegenerated
$sessionStarted

Public Methods

Method Description
__construct ( array $options = [] ) Available options:
getId ( ) {@inheritDoc}
read ( string $key, string $default = null ) : mixed Reads data from this storage.
regenerate ( boolean $destroy = false ) : boolean Regenerates id that represents this storage.
remove ( string $key ) : mixed Removes data from this storage.
start ( ) Starts the session.
write ( string $key, mixed $data ) Writes data to this storage.

Method Details

__construct() public method

* name: The cookie name (null [ommited] by default) * id: The session id (null [ommited] by default) * lifetime: Cookie lifetime * path: Cookie path * domain: Cookie domain * secure: Cookie secure * httponly: Cookie http only The default values for most options are those returned by the session_get_cookie_params() function
public __construct ( array $options = [] )
$options array An associative array of session options

getId() public method

{@inheritDoc}
public getId ( )

read() public method

The preferred format for a key is directory style so naming conflicts can be avoided.
public read ( string $key, string $default = null ) : mixed
$key string A unique key identifying your data
$default string Default value
return mixed Data associated with the key

regenerate() public method

Regenerates id that represents this storage.
public regenerate ( boolean $destroy = false ) : boolean
$destroy boolean Destroy session when regenerating?
return boolean True if session regenerated, false if error

remove() public method

The preferred format for a key is directory style so naming conflicts can be avoided.
public remove ( string $key ) : mixed
$key string A unique key identifying your data
return mixed Data associated with the key

start() public method

Starts the session.
public start ( )

write() public method

The preferred format for a key is directory style so naming conflicts can be avoided.
public write ( string $key, mixed $data )
$key string A unique key identifying your data
$data mixed Data associated with your key

Property Details

$options protected property

protected $options

$sessionIdRegenerated protected static property

protected static $sessionIdRegenerated

$sessionStarted protected static property

protected static $sessionStarted