2012-01-07 22:50:16 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
2013-02-08 11:59:49 +00:00
|
|
|
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
2012-01-07 22:50:16 +00:00
|
|
|
*
|
|
|
|
* Licensed under The MIT License
|
2013-02-08 12:22:51 +00:00
|
|
|
* For full copyright and license information, please see the LICENSE.txt
|
2012-01-07 22:50:16 +00:00
|
|
|
* Redistributions of files must retain the above copyright notice.
|
|
|
|
*
|
2013-02-08 11:59:49 +00:00
|
|
|
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
2012-01-07 22:50:16 +00:00
|
|
|
* @link http://cakephp.org CakePHP(tm) Project
|
|
|
|
* @package Cake.Model.Datasource
|
|
|
|
* @since CakePHP(tm) v 2.1
|
2013-05-30 22:11:14 +00:00
|
|
|
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
2012-01-07 22:50:16 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2012-12-22 22:48:15 +00:00
|
|
|
* Interface for Session handlers. Custom session handler classes should implement
|
2012-01-07 22:50:16 +00:00
|
|
|
* this interface as it allows CakeSession know how to map methods to session_set_save_handler()
|
|
|
|
*
|
|
|
|
* @package Cake.Model.Datasource.Session
|
|
|
|
*/
|
|
|
|
interface CakeSessionHandlerInterface {
|
2012-03-04 19:18:04 +00:00
|
|
|
|
2012-01-07 22:50:16 +00:00
|
|
|
/**
|
|
|
|
* Method called on open of a session.
|
|
|
|
*
|
|
|
|
* @return boolean Success
|
|
|
|
*/
|
|
|
|
public function open();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Method called on close of a session.
|
|
|
|
*
|
|
|
|
* @return boolean Success
|
|
|
|
*/
|
|
|
|
public function close();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Method used to read from a session.
|
|
|
|
*
|
2012-05-13 00:43:31 +00:00
|
|
|
* @param string $id The key of the value to read
|
2012-01-07 22:50:16 +00:00
|
|
|
* @return mixed The value of the key or false if it does not exist
|
|
|
|
*/
|
|
|
|
public function read($id);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Helper function called on write for sessions.
|
|
|
|
*
|
|
|
|
* @param integer $id ID that uniquely identifies session in database
|
|
|
|
* @param mixed $data The value of the data to be saved.
|
|
|
|
* @return boolean True for successful write, false otherwise.
|
|
|
|
*/
|
|
|
|
public function write($id, $data);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Method called on the destruction of a session.
|
|
|
|
*
|
|
|
|
* @param integer $id ID that uniquely identifies session in database
|
|
|
|
* @return boolean True for successful delete, false otherwise.
|
|
|
|
*/
|
|
|
|
public function destroy($id);
|
|
|
|
|
|
|
|
/**
|
2012-12-22 22:48:15 +00:00
|
|
|
* Run the Garbage collection on the session storage. This method should vacuum all
|
2012-01-07 22:50:16 +00:00
|
|
|
* expired or dead sessions.
|
|
|
|
*
|
|
|
|
* @param integer $expires Timestamp (defaults to current time)
|
|
|
|
* @return boolean Success
|
|
|
|
*/
|
|
|
|
public function gc($expires = null);
|
2012-03-04 19:18:04 +00:00
|
|
|
|
2012-01-07 22:50:16 +00:00
|
|
|
}
|