This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/includes/kohana/system/classes/Kohana/Session/Cookie.php

56 lines
932 B
PHP
Raw Normal View History

2012-11-09 12:18:50 +00:00
<?php defined('SYSPATH') OR die('No direct script access.');
2010-08-21 04:43:03 +00:00
/**
* Cookie-based session class.
*
* @package Kohana
* @category Session
* @author Kohana Team
2012-11-09 12:18:50 +00:00
* @copyright (c) 2008-2012 Kohana Team
2011-05-13 06:00:25 +00:00
* @license http://kohanaframework.org/license
2010-08-21 04:43:03 +00:00
*/
class Kohana_Session_Cookie extends Session {
2011-05-13 06:00:25 +00:00
/**
* @param string $id session id
* @return string
*/
2010-08-21 04:43:03 +00:00
protected function _read($id = NULL)
{
return Cookie::get($this->_name, NULL);
}
2011-05-13 06:00:25 +00:00
/**
* @return null
*/
2010-08-21 04:43:03 +00:00
protected function _regenerate()
{
// Cookie sessions have no id
return NULL;
}
2011-05-13 06:00:25 +00:00
/**
* @return bool
*/
2010-08-21 04:43:03 +00:00
protected function _write()
{
return Cookie::set($this->_name, $this->__toString(), $this->_lifetime);
}
2012-11-09 12:18:50 +00:00
/**
* @return bool
*/
protected function _restart()
{
return TRUE;
}
2011-05-13 06:00:25 +00:00
/**
* @return bool
*/
2010-08-21 04:43:03 +00:00
protected function _destroy()
{
return Cookie::delete($this->_name);
}
} // End Session_Cookie