PHP Класс SimpleSAML_SessionHandlerCookie, simplesamlphp

This file defines a base class for session handlers that need to store the session id in a cookie. It takes care of storing and retrieving the session id.
Автор: Olav Morken, UNINETT AS. ([email protected])
Наследование: extends SimpleSAML_SessionHandler
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$cookie_name string This variable contains the session cookie name.

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

Метод Описание
getCookieSessionId ( ) : string | null Retrieve the session ID saved in the session cookie, if there's one.
getSessionCookieName ( ) : string Retrieve the session cookie name.
hasSessionCookie ( ) : boolean Check whether the session cookie is set.
newSessionId ( ) : string Create a new session id.
setCookie ( string $sessionName, string | null $sessionID, array $cookieParams = null ) Set a session cookie.

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

Метод Описание
__construct ( ) This constructor initializes the session id based on what we receive in a cookie. We create a new session id and set a cookie with this id if we don't have a session id.

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

Метод Описание
createSessionID ( ) : string This static function creates a session id. A session id consists of 32 random hexadecimal characters.
isValidSessionID ( string $session_id ) : boolean This static function validates a session id. A session id is valid if it only consists of characters which are allowed in a session id and it is the correct length.

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

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

This constructor initializes the session id based on what we receive in a cookie. We create a new session id and set a cookie with this id if we don't have a session id.
protected __construct ( )

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

Retrieve the session ID saved in the session cookie, if there's one.
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.
public getSessionCookieName ( ) : string
Результат string The session cookie name.

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 otherwise.

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

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

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

Set a session cookie.
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.

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