ClearableTokenStorageInterface
extends
TokenStorageInterface
in
Stores CSRF tokens.
Tags
Table of Contents
Methods
- clear() : mixed
- Removes all CSRF tokens.
- getToken() : string
- Reads a stored CSRF token.
- hasToken() : bool
- Checks whether a token with the given token ID exists.
- removeToken() : string|null
- Removes a CSRF token.
- setToken() : mixed
- Stores a CSRF token.
Methods
clear()
Removes all CSRF tokens.
public
clear() : mixed
getToken()
Reads a stored CSRF token.
public
getToken(string $tokenId) : string
Parameters
- $tokenId : string
Tags
Return values
stringhasToken()
Checks whether a token with the given token ID exists.
public
hasToken(string $tokenId) : bool
Parameters
- $tokenId : string
Return values
boolremoveToken()
Removes a CSRF token.
public
removeToken(string $tokenId) : string|null
Parameters
- $tokenId : string
Return values
string|null —Returns the removed token if one existed, NULL otherwise
setToken()
Stores a CSRF token.
public
setToken(string $tokenId, string $token) : mixed
Parameters
- $tokenId : string
- $token : string