ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
SessionHandler.php
Go to the documentation of this file.
1 <?php
2 
15 namespace SimpleSAML;
16 
17 abstract class SessionHandler
18 {
19 
20 
28  protected static $sessionHandler = null;
29 
30 
38  public static function getSessionHandler()
39  {
40  if (self::$sessionHandler === null) {
41  self::createSessionHandler();
42  }
43 
44  return self::$sessionHandler;
45  }
46 
47 
53  protected function __construct()
54  {
55  }
56 
57 
63  abstract public function newSessionId();
64 
65 
71  abstract public function getCookieSessionId();
72 
73 
79  abstract public function getSessionCookieName();
80 
81 
87  abstract public function saveSession(\SimpleSAML_Session $session);
88 
89 
97  abstract public function loadSession($sessionId = null);
98 
99 
109  abstract public function setCookie($sessionName, $sessionID, array $cookieParams = null);
110 
111 
120  private static function createSessionHandler()
121  {
123  if ($store === false) {
124  self::$sessionHandler = new SessionHandlerPHP();
125  } else {
127  self::$sessionHandler = new SessionHandlerStore($store);
128  }
129  }
130 
131 
139  public function hasSessionCookie()
140  {
141  return true;
142  }
143 
144 
151  public function getCookieParams()
152  {
154 
155  return array(
156  'lifetime' => $config->getInteger('session.cookie.lifetime', 0),
157  'path' => $config->getString('session.cookie.path', '/'),
158  'domain' => $config->getString('session.cookie.domain', null),
159  'secure' => $config->getBoolean('session.cookie.secure', false),
160  'httponly' => true,
161  );
162  }
163 }
$sessionID
$session
if(! $oauthconfig->getBoolean('getUserInfo.enable', FALSE)) $store
Definition: getUserInfo.php:11
hasSessionCookie()
Check whether the session cookie is set.
Attribute-related utility methods.
Create styles array
The data for the language used.
static getSessionHandler()
This function retrieves the current instance of the session handler.
static getInstance()
Retrieve our singleton instance.
Definition: Store.php:31
getCookieParams()
Get the cookie parameters that should be used for session cookies.
__construct()
This constructor is included in case it is needed in the future.
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.