Csrf
in package
Table of Contents
Properties
Methods
- __construct() : mixed
- csrfGenerate() : array<string|int, string>
- Generates token for CSRF protection
- csrfVerify() : bool
Properties
$config
private
Config
$config
$escaper
private
Escaper
$escaper
$hmacKey
private
string
$hmacKey
$scrfSessionIndex
private
string
$scrfSessionIndex
= 'csrf'
$session
private
Session
$session
Methods
__construct()
public
__construct(Config $config, Session $session, Escaper $escaper) : mixed
Parameters
csrfGenerate()
Generates token for CSRF protection
public
csrfGenerate() : array<string|int, string>
Return values
array<string|int, string> —Form index, token and html input tag
csrfVerify()
public
csrfVerify(array<string|int, mixed> $post[, bool $deleteToken = false ]) : bool
Parameters
- $post : array<string|int, mixed>
- $deleteToken : bool = false