Token
in package
Validates and generates CSRF tokens.
Tags
Table of Contents
Methods
- check() : bool
- Check if token in session matches current token.
- generate() : void
- Generate a form token and store in a session variable.
- get() : string
- Get current form token.
Methods
check()
Check if token in session matches current token.
public
static check([string|null $token = null ]) : bool
Parameters
- $token : string|null = null
-
Contains the form token which will be checked against the session variable.
Tags
Return values
bool —Whether token matches.
generate()
Generate a form token and store in a session variable.
public
static generate() : void
get()
Get current form token.
public
static get() : string
Return values
string —current form token.