interface TokenStorageInterface

Stores CSRF tokens.

Methods

string
getToken(string $tokenId)

Reads a stored CSRF token.

setToken(string $tokenId, string $token)

Stores a CSRF token.

string|null
removeToken(string $tokenId)

Removes a CSRF token.

bool
hasToken(string $tokenId)

Checks whether a token with the given token ID exists.

Details

at line line 30
string getToken(string $tokenId)

Reads a stored CSRF token.

Parameters

string $tokenId The token ID

Return Value

string The stored token

Exceptions

TokenNotFoundException If the token ID does not exist

at line line 38
setToken(string $tokenId, string $token)

Stores a CSRF token.

Parameters

string $tokenId The token ID
string $token The CSRF token

at line line 48
string|null removeToken(string $tokenId)

Removes a CSRF token.

Parameters

string $tokenId The token ID

Return Value

string|null Returns the removed token if one existed, NULL otherwise

at line line 57
bool hasToken(string $tokenId)

Checks whether a token with the given token ID exists.

Parameters

string $tokenId The token ID

Return Value

bool Whether a token exists with the given ID