SessionTokenStorage
extends AbstractTokenStorage
in package
Uses the session to store the CSRF token
Table of Contents
- __construct() : mixed
- __destruct() : mixed
- add() : void
- Adds a token to the storage
- clearExpired() : void
- Removes all expired tokens
- commit() : void
- Store the token between requests
- isValid() : bool
- Determines if the storage contains a matching token and if it is valid.
- queryAll() : array<string|int, CsrfToken>
- Returns all tokens
- queryOne() : CsrfToken|null
- Returns a single token
Methods
__construct()
public
__construct(AbstractSession $sessionVars[, string $requestId = REQUEST_ID_KEY ][, int $maxCount = TOKEN_MAX ]) : mixed
Parameters
- $sessionVars : AbstractSession
- $requestId : string = REQUEST_ID_KEY
- $maxCount : int = TOKEN_MAX
Return values
mixed —__destruct()
public
__destruct() : mixed
Return values
mixed —add()
Adds a token to the storage
public
add(CsrfToken $token) : void
Parameters
- $token : CsrfToken
Return values
void —clearExpired()
Removes all expired tokens
public
clearExpired() : void
Return values
void —commit()
Store the token between requests
public
commit() : void
Return values
void —isValid()
Determines if the storage contains a matching token and if it is valid.
public
isValid(string $stringToken) : bool
Parameters
- $stringToken : string
Return values
bool —queryAll()
Returns all tokens
public
queryAll() : array<string|int, CsrfToken>
Return values
array<string|int, CsrfToken> —queryOne()
Returns a single token
public
queryOne(int $index) : CsrfToken|null
Parameters
- $index : int