SproutCMS

This is the code documentation for the SproutCMS project

source of /sprout/Helpers/Drivers/SessionDriver.php

Copyright (C) 2017 Karmabunny Pty Ltd.

This file is a part of SproutCMS.

SproutCMS is free software: you can redistribute it and/or modify it under the terms
of the GNU General Public License as published by the Free Software Foundation, either
version 2 of the License, or (at your option) any later version.

For more information, visit <http://getsproutcms.com>.

This class was originally from Kohana 2.3.4
Copyright 2007-2008 Kohana Team
  1. <?php
  2. /**
  3.  * Copyright (C) 2017 Karmabunny Pty Ltd.
  4.  *
  5.  * This file is a part of SproutCMS.
  6.  *
  7.  * SproutCMS is free software: you can redistribute it and/or modify it under the terms
  8.  * of the GNU General Public License as published by the Free Software Foundation, either
  9.  * version 2 of the License, or (at your option) any later version.
  10.  *
  11.  * For more information, visit <http://getsproutcms.com>.
  12.  *
  13.  * This class was originally from Kohana 2.3.4
  14.  * Copyright 2007-2008 Kohana Team
  15.  */
  16. namespace Sprout\Helpers\Drivers;
  17.  
  18.  
  19. /**
  20.  * Session driver interface
  21.  */
  22. interface SessionDriver {
  23.  
  24. /**
  25.   * Opens a session.
  26.   *
  27.   * @param string save path
  28.   * @param string session name
  29.   * @return boolean
  30.   */
  31. public function open($path, $name);
  32.  
  33. /**
  34.   * Closes a session.
  35.   *
  36.   * @return boolean
  37.   */
  38. public function close();
  39.  
  40. /**
  41.   * Reads a session.
  42.   *
  43.   * @param string session id
  44.   * @return string
  45.   */
  46. public function read($id);
  47.  
  48. /**
  49.   * Writes a session.
  50.   *
  51.   * @param string session id
  52.   * @param string session data
  53.   * @return boolean
  54.   */
  55. public function write($id, $data);
  56.  
  57. /**
  58.   * Destroys a session.
  59.   *
  60.   * @param string session id
  61.   * @return boolean
  62.   */
  63. public function destroy($id);
  64.  
  65. /**
  66.   * Regenerates the session id.
  67.   *
  68.   * @return string
  69.   */
  70. public function regenerate();
  71.  
  72. /**
  73.   * Garbage collection.
  74.   *
  75.   * @param integer session expiration period
  76.   * @return boolean
  77.   */
  78. public function gc($maxlifetime);
  79.  
  80. } // End Session Driver Interface
  81.