\Cake\Http\SessionCacheSession

CacheSession provides method for saving sessions into a Cache engine. Used with Session

Summary

Methods
Properties
Constants
__construct()
open()
close()
read()
write()
destroy()
gc()
No public properties found
No constants found
No protected methods found
$_options
N/A
No private methods found
No private properties found
N/A

Properties

$_options

$_options : array

Options for this session engine

Type

array

Methods

__construct()

__construct(array  $config = array()) 

Constructor.

Parameters

array $config

The configuration to use for this engine It requires the key 'config' which is the name of the Cache config to use for storing the session

Throws

\InvalidArgumentException

if the 'config' key is not provided

open()

open(string  $savePath, string  $name) : boolean

Method called on open of a database session.

Parameters

string $savePath

The path where to store/retrieve the session.

string $name

The session name.

Returns

boolean —

Success

close()

close() : boolean

Method called on close of a database session.

Returns

boolean —

Success

read()

read(string|integer  $id) : string

Method used to read from a cache session.

Parameters

string|integer $id

ID that uniquely identifies session in cache.

Returns

string —

Session data or empty string if it does not exist.

write()

write(string|integer  $id, mixed  $data) : boolean

Helper function called on write for cache sessions.

Parameters

string|integer $id

ID that uniquely identifies session in cache.

mixed $data

The data to be saved.

Returns

boolean —

True for successful write, false otherwise.

destroy()

destroy(string|integer  $id) : boolean

Method called on the destruction of a cache session.

Parameters

string|integer $id

ID that uniquely identifies session in cache.

Returns

boolean —

Always true.

gc()

gc(integer  $maxlifetime) : boolean

Helper function called on gc for cache sessions.

Parameters

integer $maxlifetime

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

Returns

boolean —

Always true.