Class CacheSession

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

Cake\Network\Session\CacheSession implements SessionHandlerInterface
Namespace: Cake\Network\Session
See: \Cake\Model\Datasource\Session for configuration information.
Located at Network/Session/CacheSession.php

Method Detail

__constructsource public

__construct( array $config [] )

Constructor.

Parameters

array $config optional []
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

closesource public

close( )

Method called on close of a database session.

Returns

boolean
Success

Implementation of

SessionHandlerInterface::close()

destroysource public

destroy( integer $id )

Method called on the destruction of a cache session.

Parameters

integer $id
ID that uniquely identifies session in cache

Returns

boolean
True for successful delete, false otherwise.

Implementation of

SessionHandlerInterface::destroy()

gcsource public

gc( string $maxlifetime )

Helper function called on gc for cache sessions.

Parameters

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

Returns

boolean
True (irrespective of whether or not the garbage is being successfully collected)

Implementation of

SessionHandlerInterface::gc()

opensource public

open( string $savePath , string $name )

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

Implementation of

SessionHandlerInterface::open()

readsource public

read( string $id )

Method used to read from a cache session.

Parameters

string $id
The key of the value to read

Returns

string
The value of the key or empty if it does not exist

Implementation of

SessionHandlerInterface::read()

writesource public

write( integer $id , mixed $data )

Helper function called on write for cache sessions.

Parameters

integer $id
ID that uniquely identifies session in database
mixed $data
The value of the data to be saved.

Returns

boolean
True for successful write, false otherwise.

Implementation of

SessionHandlerInterface::write()

Properties summary

$_optionssource

protected array

Options for this session engine

[]

© 2005–2016 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
http://api.cakephp.org/3.1/class-Cake.Network.Session.CacheSession.html