AbstractTokenStorage
in package
Used to store and validate tokens used to mitigate CSRF attacks
Table of Contents
- 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
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
abstract 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
abstract queryAll() : array<string|int, CsrfToken>
Return values
array<string|int, CsrfToken> —queryOne()
Returns a single token
public
abstract queryOne(int $index) : CsrfToken|null
Parameters
- $index : int