Interface CakeSessionHandlerInterface

Interface for Session handlers. Custom session handler classes should implement this interface as it allows CakeSession know how to map methods to session_set_save_handler()

Direct Implementers

Package: Cake\Model\Datasource\Session
Copyright: Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
License: MIT License
Location: Cake/Model/Datasource/Session/CakeSessionHandlerInterface.php

Method Summary

  • close() public
    Method called on close of a session.
  • destroy() public
    Method called on the destruction of a session.
  • gc() public

    Run the Garbage collection on the session storage. This method should vacuum all expired or dead sessions.

  • open() public
    Method called on open of a session.
  • read() public
    Method used to read from a session.
  • write() public
    Helper function called on write for sessions.

Method Detail

close()source public

close( )

Method called on close of a session.

Returns

boolean
Success

destroy()source public

destroy( integer $id )

Method called on the destruction of a session.

Parameters

integer $id
ID that uniquely identifies session in database

Returns

boolean
True for successful delete, false otherwise.

gc()source public

gc( integer $expires null )

Run the Garbage collection on the session storage. This method should vacuum all expired or dead sessions.

Parameters

integer $expires optional null
Timestamp (defaults to current time)

Returns

boolean
Success

open()source public

open( )

Method called on open of a session.

Returns

boolean
Success

read()source public

read( string $id )

Method used to read from a session.

Parameters

string $id
The key of the value to read

Returns

mixed
The value of the key or false if it does not exist

write()source public

write( integer $id , mixed $data )

Helper function called on write for 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.

© 2005–2017 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.
https://api.cakephp.org/2.10/class-CakeSessionHandlerInterface.html