PHP Класс SimpleSAML_SessionHandler, simplesamlphp

This file defines a base class for session handling. Instantiation of session handler objects should be done through the class method getSessionHandler().
Автор: Olav Morken, UNINETT AS. ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$sessionHandler SimpleSAML_SessionHandler This static variable contains a reference to the current instance of the session handler. This variable will be NULL if we haven't instantiated a session handler yet.

Открытые методы

Метод Описание
getCookieParams ( ) : array Get the cookie parameters that should be used for session cookies.
getCookieSessionId ( ) : string | null Retrieve the session ID saved in the session cookie, if there's one.
getSessionCookieName ( ) : string Retrieve the session cookie name.
getSessionHandler ( ) : SimpleSAML_SessionHandler This function retrieves the current instance of the session handler.
hasSessionCookie ( ) : boolean Check whether the session cookie is set.
loadSession ( string | null $sessionId = null ) : SimpleSAML_Session | null Load the session.
newSessionId ( ) : string Create a new session id.
saveSession ( SimpleSAML_Session $session ) Save the session.
setCookie ( string $sessionName, string | null $sessionID, array $cookieParams = null ) Set a session cookie.

Защищенные методы

Метод Описание
__construct ( ) This constructor is included in case it is needed in the the future. Including it now allows us to write parent::__construct() in the subclasses of this class.

Приватные методы

Метод Описание
createSessionHandler ( ) Initialize the session handler.

Описание методов

__construct() защищенный Метод

This constructor is included in case it is needed in the the future. Including it now allows us to write parent::__construct() in the subclasses of this class.
protected __construct ( )

getCookieParams() публичный Метод

Get the cookie parameters that should be used for session cookies.
public getCookieParams ( ) : array
Результат array An array with the cookie parameters.

getCookieSessionId() абстрактный публичный Метод

Retrieve the session ID saved in the session cookie, if there's one.
abstract public getCookieSessionId ( ) : string | null
Результат string | null The session id saved in the cookie or null if no session cookie was set.

getSessionCookieName() абстрактный публичный Метод

Retrieve the session cookie name.
abstract public getSessionCookieName ( ) : string
Результат string The session cookie name.

getSessionHandler() публичный статический Метод

The session handler will be instantiated if this is the first call to this function.
public static getSessionHandler ( ) : SimpleSAML_SessionHandler
Результат SimpleSAML_SessionHandler The current session handler.

hasSessionCookie() публичный Метод

This function will only return false if is is certain that the cookie isn't set.
public hasSessionCookie ( ) : boolean
Результат boolean True if it was set, false if not.

loadSession() абстрактный публичный Метод

Load the session.
abstract public loadSession ( string | null $sessionId = null ) : SimpleSAML_Session | null
$sessionId string | null The ID of the session we should load, or null to use the default.
Результат SimpleSAML_Session | null The session object, or null if it doesn't exist.

newSessionId() абстрактный публичный Метод

Create a new session id.
abstract public newSessionId ( ) : string
Результат string The new session id.

saveSession() абстрактный публичный Метод

Save the session.
abstract public saveSession ( SimpleSAML_Session $session )
$session SimpleSAML_Session The session object we should save.

setCookie() абстрактный публичный Метод

Set a session cookie.
abstract public setCookie ( string $sessionName, string | null $sessionID, array $cookieParams = null )
$sessionName string The name of the session.
$sessionID string | null The session ID to use. Set to null to delete the cookie.
$cookieParams array Additional parameters to use for the session cookie.

Описание свойств

$sessionHandler защищенное статическое свойство

This static variable contains a reference to the current instance of the session handler. This variable will be NULL if we haven't instantiated a session handler yet.
protected static SimpleSAML_SessionHandler $sessionHandler
Результат SimpleSAML_SessionHandler