ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
SessionHandlerStore.php
Go to the documentation of this file.
1 <?php
2 
3 
10 namespace SimpleSAML;
11 
13 {
14 
20  private $store;
21 
22 
28  protected function __construct(Store $store)
29  {
30  parent::__construct();
31 
32  $this->store = $store;
33  }
34 
35 
43  public function loadSession($sessionId = null)
44  {
45  assert(is_string($sessionId) || $sessionId === null);
46 
47  if ($sessionId === null) {
48  $sessionId = $this->getCookieSessionId();
49  if ($sessionId === null) {
50  // no session cookie, nothing to load
51  return null;
52  }
53  }
54 
55  $session = $this->store->get('session', $sessionId);
56  if ($session !== null) {
57  assert($session instanceof \SimpleSAML_Session);
58  return $session;
59  }
60 
61  return null;
62  }
63 
64 
71  {
72  $sessionId = $session->getSessionId();
73 
75  $sessionDuration = $config->getInteger('session.duration', 8 * 60 * 60);
76  $expire = time() + $sessionDuration;
77 
78  $this->store->set('session', $sessionId, $session, $expire);
79  }
80 }
$expire
Definition: saml2-acs.php:140
$config
Definition: bootstrap.php:15
getSessionId()
Retrieve the session ID of this session.
Definition: Session.php:507
saveSession(\SimpleSAML_Session $session)
Save a session to the data store.
$session
__construct(Store $store)
Initialize the session.
if(! $oauthconfig->getBoolean('getUserInfo.enable', FALSE)) $store
Definition: getUserInfo.php:11
Attribute-related utility methods.
loadSession($sessionId=null)
Load a session from the data store.
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.