Back to CMSApplication class

Method checkToken

public bool
checkToken
(mixed $method = 'post')
Checks for a form token in the request.
Parameters
  • string $method The request method in which to look for the token key.
Returns
  • bool True if found and valid, false otherwise.
Since
  • 4.0.0

Method checkToken - Source code

/**
 * Checks for a form token in the request.
 *
 * Use in conjunction with getFormToken.
 *
 * @param   string  $method  The request method in which to look for the token key.
 *
 * @return  boolean  True if found and valid, false otherwise.
 *
 * @since   4.0.0
 */
public function checkToken($method = 'post')
{
    /** @var Session $session */
    $session = $this->getSession();
    return $session->checkToken($method);
}