Download the PHP package fyre/csrf without Composer
On this page you can find all versions of the php package fyre/csrf. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package csrf
FyreCSRF
FyreCSRF is a free, open-source CSRF protection library for PHP.
Table Of Contents
- Installation
- Methods
- Middleware
Installation
Using Composer
In PHP:
Methods
Check Token
Check CSRF token.
$request
is the ServerRequest.
Disable
Disable the CSRF protection.
Enable
Enable the CSRF protection.
Get Field
Get the CSRF token field name.
Get Header
Get the CSRF token header name.
Get Key
Get the CSRF session key.
Get Token
Get the CSRF token.
Get Token Hash
Get the CSRF token hash.
Is Enabled
Determine if the CSRF protection is enabled.
Set Field
Set the CSRF token field name.
$field
is a string representing the CSRF token field name.
Set Header
Set the CSRF token header name.
$header
is a string representing the CSRF token header name.
Set Key
Set the CSRF session key.
$key
is a string representing the CSRF session key.
Skip Check Callback
Set the skip check callback.
$skipCheck
is a Closure that accepts a ServerRequest as the first argument.
The skip check callback should return true if the CSRF check should not be performed.
Middleware
$options
is an array containing options for the middleware.field
is a string representing the CSRF token field name, and will default to "csrf_token".header
is a string representing the CSRF token header name, and will default to "Csrf-Token".key
is a string representing the CSRF session key and will default to "_csrfToken".skipCheck
is a Closure that accepts a ServerRequest as the first argument.
The skip check callback should return true if the CSRF check should not be performed.
Process
$request
is a ServerRequest.$handler
is a RequestHandler.
This method will return a ClientResponse.