NativeSessionTokenStorage
in package
implements
ClearableTokenStorageInterface
Token storage that uses PHP's native session handling.
Tags
Interfaces, Classes, Traits and Enums
- ClearableTokenStorageInterface
- Stores CSRF tokens.
Table of Contents
- SESSION_NAMESPACE = '_csrf'
- The namespace used to store values in the session.
- $namespace : mixed
- $sessionStarted : mixed
- __construct() : mixed
- Initializes the storage with a session namespace.
- clear() : mixed
- Removes all CSRF tokens.
- getToken() : mixed
- {@inheritdoc}
- hasToken() : mixed
- {@inheritdoc}
- removeToken() : mixed
- {@inheritdoc}
- setToken() : mixed
- {@inheritdoc}
- startSession() : mixed
Constants
SESSION_NAMESPACE
The namespace used to store values in the session.
public
mixed
SESSION_NAMESPACE
= '_csrf'
Properties
$namespace
private
mixed
$namespace
$sessionStarted
private
mixed
$sessionStarted
= false
Methods
__construct()
Initializes the storage with a session namespace.
public
__construct([string $namespace = self::SESSION_NAMESPACE ]) : mixed
Parameters
- $namespace : string = self::SESSION_NAMESPACE
-
The namespace under which the token is stored in the session
Return values
mixed —clear()
Removes all CSRF tokens.
public
clear() : mixed
Return values
mixed —getToken()
{@inheritdoc}
public
getToken(string $tokenId) : mixed
Parameters
- $tokenId : string
Return values
mixed —hasToken()
{@inheritdoc}
public
hasToken(string $tokenId) : mixed
Parameters
- $tokenId : string
Return values
mixed —removeToken()
{@inheritdoc}
public
removeToken(string $tokenId) : mixed
Parameters
- $tokenId : string
Return values
mixed —setToken()
{@inheritdoc}
public
setToken(string $tokenId, string $token) : mixed
Parameters
- $tokenId : string
- $token : string
Return values
mixed —startSession()
private
startSession() : mixed