Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Třída existuje, aby se vůbec neukládala session, tam kde není potřeba.
- * Například v API, nebo v Cronu se různě sahá na session, i když se reálně mezi requesty nepřenáší.
- *
- * @internal
- */
- class ArraySessionStorage extends Nette\Object implements Nette\Http\ISessionStorage
- {
- /**
- * @var array
- */
- private $session;
- public function open($savePath, $sessionName)
- {
- $this->session = array();
- }
- public function close()
- {
- $this->session = array();
- }
- public function read($id)
- {
- return isset($this->session[$id]) ? $this->session[$id] : NULL;
- }
- public function write($id, $data)
- {
- $this->session[$id] = $data;
- }
- public function remove($id)
- {
- unset($this->session[$id]);
- }
- public function clean($maxlifetime)
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment