ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
SimpleSAML\SessionHandler Class Reference
+ Inheritance diagram for SimpleSAML\SessionHandler:
+ Collaboration diagram for SimpleSAML\SessionHandler:

Public Member Functions

 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...
 
 setCookie ($sessionName, $sessionID, array $cookieParams=null)
 Set a session cookie. More...
 
 hasSessionCookie ()
 Check whether the session cookie is set. More...
 
 getCookieParams ()
 Get the cookie parameters that should be used for session cookies. More...
 

Static Public Member Functions

static getSessionHandler ()
 This function retrieves the current instance of the session handler. More...
 

Protected Member Functions

 __construct ()
 This constructor is included in case it is needed in the future. More...
 

Static Protected Attributes

static $sessionHandler = null
 

Detailed Description

Definition at line 17 of file SessionHandler.php.

Constructor & Destructor Documentation

◆ __construct()

SimpleSAML\SessionHandler::__construct ( )
protected

This constructor is included in case it is needed in the future.

Including it now allows us to write parent::__construct() in the subclasses of this class.

Reimplemented in SimpleSAML\SessionHandlerCookie, and SimpleSAML\SessionHandlerPHP.

Definition at line 53 of file SessionHandler.php.

54 {
55 }

Member Function Documentation

◆ getCookieParams()

SimpleSAML\SessionHandler::getCookieParams ( )

Get the cookie parameters that should be used for session cookies.

Returns
array An array with the cookie parameters. http://www.php.net/manual/en/function.session-get-cookie-params.php

Reimplemented in SimpleSAML\SessionHandlerPHP.

Definition at line 151 of file SessionHandler.php.

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 }
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.

References $config, and SimpleSAML_Configuration\getInstance().

+ Here is the call graph for this function:

◆ getCookieSessionId()

SimpleSAML\SessionHandler::getCookieSessionId ( )
abstract

Retrieve the session ID saved in the session cookie, if there's one.

Returns
string|null The session id saved in the cookie or null if no session cookie was set.

Reimplemented in SimpleSAML\SessionHandlerCookie, and SimpleSAML\SessionHandlerPHP.

◆ getSessionCookieName()

SimpleSAML\SessionHandler::getSessionCookieName ( )
abstract

Retrieve the session cookie name.

Returns
string The session cookie name.

Reimplemented in SimpleSAML\SessionHandlerCookie, and SimpleSAML\SessionHandlerPHP.

◆ getSessionHandler()

static SimpleSAML\SessionHandler::getSessionHandler ( )
static

This function retrieves the current instance of the session handler.

The session handler will be instantiated if this is the first call to this function.

Returns
\SimpleSAML\SessionHandler The current session handler.

Definition at line 38 of file SessionHandler.php.

39 {
40 if (self::$sessionHandler === null) {
41 self::createSessionHandler();
42 }
43
45 }

Referenced by SimpleSAML_Session\__construct(), SimpleSAML_Session\cleanup(), SimpleSAML_Session\doLogin(), SimpleSAML_Session\getSession(), SimpleSAML_Session\hasSessionCookie(), sspmod_core_Auth_Process_ExtendIdPSession\process(), SimpleSAML_Session\save(), and SimpleSAML_Session\updateSessionCookies().

+ Here is the caller graph for this function:

◆ hasSessionCookie()

SimpleSAML\SessionHandler::hasSessionCookie ( )

Check whether the session cookie is set.

This function will only return false if is is certain that the cookie isn't set.

Returns
bool True if it was set, false if not.

Reimplemented in SimpleSAML\SessionHandlerCookie, and SimpleSAML\SessionHandlerPHP.

Definition at line 139 of file SessionHandler.php.

140 {
141 return true;
142 }

◆ loadSession()

SimpleSAML\SessionHandler::loadSession (   $sessionId = null)
abstract

Load the session.

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

Reimplemented in SimpleSAML\SessionHandlerPHP, and SimpleSAML\SessionHandlerStore.

◆ newSessionId()

SimpleSAML\SessionHandler::newSessionId ( )
abstract

Create a new session id.

Returns
string The new session id.

Reimplemented in SimpleSAML\SessionHandlerCookie, and SimpleSAML\SessionHandlerPHP.

◆ saveSession()

SimpleSAML\SessionHandler::saveSession ( \SimpleSAML_Session  $session)
abstract

Save the session.

Parameters
\SimpleSAML_Session$sessionThe session object we should save.

Reimplemented in SimpleSAML\SessionHandlerPHP, and SimpleSAML\SessionHandlerStore.

◆ setCookie()

SimpleSAML\SessionHandler::setCookie (   $sessionName,
  $sessionID,
array  $cookieParams = null 
)
abstract

Set a session cookie.

Parameters
string$sessionNameThe name of the session.
string | null$sessionIDThe session ID to use. Set to null to delete the cookie.
array | null$cookieParamsAdditional parameters to use for the session cookie.
Exceptions

SimpleSAML\Error\CannotSetCookie If we can't set the cookie.

Reimplemented in SimpleSAML\SessionHandlerCookie, and SimpleSAML\SessionHandlerPHP.

Field Documentation

◆ $sessionHandler

SimpleSAML\SessionHandler::$sessionHandler = null
staticprotected

Definition at line 28 of file SessionHandler.php.


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