ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
SimpleSAML\SessionHandlerStore Class Reference
+ Inheritance diagram for SimpleSAML\SessionHandlerStore:
+ Collaboration diagram for SimpleSAML\SessionHandlerStore:

Public Member Functions

 loadSession ($sessionId=null)
 Load a session from the data store. More...
 
 saveSession (\SimpleSAML_Session $session)
 Save a session to the data store. More...
 
- Public Member Functions inherited from SimpleSAML\SessionHandlerCookie
 newSessionId ()
 Create a new session id. More...
 
 getCookieSessionId ()
 Retrieve the session ID saved in the session cookie, if there's one. More...
 
 getSessionCookieName ()
 Retrieve the session cookie name. More...
 
 hasSessionCookie ()
 Check whether the session cookie is set. More...
 
 setCookie ($sessionName, $sessionID, array $cookieParams=null)
 Set a session cookie. More...
 
- Public Member Functions inherited from SimpleSAML\SessionHandler
 newSessionId ()
 Create a new session id. More...
 
 getCookieSessionId ()
 Retrieve the session ID saved in the session cookie, if there's one. More...
 
 getSessionCookieName ()
 Retrieve the session cookie name. More...
 
 saveSession (\SimpleSAML_Session $session)
 Save the session. More...
 
 loadSession ($sessionId=null)
 Load the session. More...
 
 hasSessionCookie ()
 Check whether the session cookie is set. More...
 
 setCookie ($sessionName, $sessionID, array $cookieParams=null)
 Set a session cookie. More...
 
 getCookieParams ()
 Get the cookie parameters that should be used for session cookies. More...
 

Protected Member Functions

 __construct (Store $store)
 Initialize the session. More...
 
- Protected Member Functions inherited from SimpleSAML\SessionHandlerCookie
 __construct ()
 This constructor initializes the session id based on what we receive in a cookie. More...
 
- Protected Member Functions inherited from SimpleSAML\SessionHandler
 __construct ()
 This constructor is included in case it is needed in the future. More...
 

Private Attributes

 $store
 

Additional Inherited Members

- Static Public Member Functions inherited from SimpleSAML\SessionHandler
static getSessionHandler ()
 This function retrieves the current instance of the session handler. More...
 
- Protected Attributes inherited from SimpleSAML\SessionHandlerCookie
 $cookie_name
 
- Static Protected Attributes inherited from SimpleSAML\SessionHandler
static $sessionHandler = null
 

Detailed Description

Definition at line 12 of file SessionHandlerStore.php.

Constructor & Destructor Documentation

◆ __construct()

SimpleSAML\SessionHandlerStore::__construct ( Store  $store)
protected

Initialize the session.

Parameters
\SimpleSAML\Store$storeThe store to use.

Definition at line 28 of file SessionHandlerStore.php.

References $store.

29  {
30  parent::__construct();
31 
32  $this->store = $store;
33  }

Member Function Documentation

◆ loadSession()

SimpleSAML\SessionHandlerStore::loadSession (   $sessionId = null)

Load a session from the data store.

Parameters
string | null$sessionIdThe ID of the session we should load, or null to use the default.
Returns
|null The session object, or null if it doesn't exist.

Definition at line 43 of file SessionHandlerStore.php.

References $session.

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  }
getCookieSessionId()
Retrieve the session ID saved in the session cookie, if there's one.
$session

◆ saveSession()

SimpleSAML\SessionHandlerStore::saveSession ( \SimpleSAML_Session  $session)

Save a session to the data store.

Parameters
\SimpleSAML_Session$sessionThe session object we should save.

Definition at line 70 of file SessionHandlerStore.php.

References $config, $expire, SimpleSAML_Configuration\getInstance(), and SimpleSAML_Session\getSessionId().

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  }
$expire
Definition: saml2-acs.php:140
$config
Definition: bootstrap.php:15
$session
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.
+ Here is the call graph for this function:

Field Documentation

◆ $store

SimpleSAML\SessionHandlerStore::$store
private

Definition at line 20 of file SessionHandlerStore.php.


The documentation for this class was generated from the following file: