CSRFVerifier
class CSRFVerifier
Properties
| static CSRFVerifier|null | $instance |
Methods
Get the singleton instance of the CSRFVerifier.
Constructor for the CSRFVerifier class.
Get the CSRF token from the session.
Add a URI pattern to the list of CSRF exceptions.
Check if a given URI matches any of the CSRF exceptions.
Validate the CSRF token in the incoming request.
Generate an HTML input element containing the CSRF token.
Details
at line 25
static CSRFVerifier
get()
Get the singleton instance of the CSRFVerifier.
at line 36
__construct()
Constructor for the CSRFVerifier class.
Starts the session and initializes the CSRF token if not already set.
at line 51
string
getToken()
Get the CSRF token from the session.
at line 60
void
addException(string $pattern)
Add a URI pattern to the list of CSRF exceptions.
at line 70
bool
isException(string $uri)
Check if a given URI matches any of the CSRF exceptions.
at line 86
bool
validateRequest(ServerRequest $request)
Validate the CSRF token in the incoming request.
at line 107
string
getTokenInput()
Generate an HTML input element containing the CSRF token.