SessionCSRF::hasValidToken() method

Returns true if the current POST request contains a valid CSRF token, false if not

Usage

// basic usage
$bool = $sessionCSRF->hasValidToken();

// usage with all arguments
$bool = $sessionCSRF->hasValidToken($id = '', $reset = null);

Arguments

NameType(s)Description
id (optional)int, string, null

Optional unique ID for this token, but required if checking a single use token.

reset (optional)

Return value

bool


SessionCSRF methods and properties

API reference based on ProcessWire core version 3.0.244

“The end client and designer love the ease at which they can update the website. Training beyond how to log in wasn’t even necessary since ProcessWire’s default interface is straightforward.” —Jonathan Lahijani