PHP Class Webiny\Component\Http\Session\Storage\CacheStorage

Inheritance: implements Webiny\Component\Http\Session\SessionStorageInterface, use trait Webiny\Component\Cache\CacheTrait
显示文件 Open project: Webiny/Framework

Public Methods

Method Description
__construct ( ConfigObject $config )
close ( ) : boolean PHP >= 5.4.0
Close the session
destroy ( integer $session_id ) : boolean PHP >= 5.4.0
Destroy a session
gc ( integer $maxlifetime ) : boolean PHP >= 5.4.0
Cleanup old sessions
open ( string $save_path, string $session_id ) : boolean PHP >= 5.4.0
Initialize session
read ( string $session_id ) : string PHP >= 5.4.0
Read session data
write ( string $session_id, string $session_data ) : boolean PHP >= 5.4.0
Write session data

Method Details

__construct() public method

public __construct ( ConfigObject $config )
$config Webiny\Component\Config\ConfigObject Config options.

close() public method

PHP >= 5.4.0
Close the session
public close ( ) : boolean
return boolean

The return value (usually TRUE on success, FALSE on failure). Note this value is returned internally to PHP for processing.

destroy() public method

PHP >= 5.4.0
Destroy a session
public destroy ( integer $session_id ) : boolean
$session_id integer The session ID being destroyed.
return boolean

The return value (usually TRUE on success, FALSE on failure). Note this value is returned internally to PHP for processing.

gc() public method

PHP >= 5.4.0
Cleanup old sessions
public gc ( integer $maxlifetime ) : boolean
$maxlifetime integer

Sessions that have not updated for the last maxlifetime seconds will be removed.

return boolean

The return value (usually TRUE on success, FALSE on failure). Note this value is returned internally to PHP for processing.

open() public method

PHP >= 5.4.0
Initialize session
public open ( string $save_path, string $session_id ) : boolean
$save_path string The path where to store/retrieve the session.
$session_id string The session id.
return boolean

The return value (usually TRUE on success, FALSE on failure). Note this value is returned internally to PHP for processing.

read() public method

PHP >= 5.4.0
Read session data
public read ( string $session_id ) : string
$session_id string The session id to read data for.
return string

Returns an encoded string of the read data. If nothing was read, it must return an empty string. Note this value is returned internally to PHP for processing.

write() public method

PHP >= 5.4.0
Write session data
public write ( string $session_id, string $session_data ) : boolean
$session_id string The session id.
$session_data string

The encoded session data. This data is the result of the PHP internally encoding the $_SESSION superglobal to a serialized string and passing it as this parameter. Please note sessions use an alternative serialization method.

return boolean

The return value (usually TRUE on success, FALSE on failure). Note this value is returned internally to PHP for processing.