while ($old !==
$str);
return stripslashes($str);
} /**
* Restore hash from Session or Cookie
*/
private function restoreHash(): void
{ if ($this->
isCSRFCookie()) { if ($this->
isHashInCookie()) { $this->hash =
$this->hashInCookie;
} } elseif ($this->session->
has($this->config->tokenName
)) { // Session based CSRF protection
$this->hash =
$this->session->
get($this->config->tokenName
);
} } /**
* Generates (Regenerates) the CSRF Hash.
*/