Property | Type | Description | |
---|---|---|---|
$cookie_name | string | This variable contains the session cookie name. |
Method | Description | |
---|---|---|
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. |
Method | Description | |
---|---|---|
__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. |
Method | Description | |
---|---|---|
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. |
protected __construct ( ) |
public getCookieSessionId ( ) : string | null | ||
return | string | null | The session id saved in the cookie or null if no session cookie was set. |
public getSessionCookieName ( ) : string | ||
return | string | The session cookie name. |
public hasSessionCookie ( ) : boolean | ||
return | boolean | True if it was set, false otherwise. |
public newSessionId ( ) : string | ||
return | string | The new session id. |
protected string $cookie_name | ||
return | string |