public function __construct(SecurityConfig
$config) { $this->config =
$config;
$this->rawCookieName =
$config->cookieName;
if ($this->
isCSRFCookie()) { $cookie =
config(CookieConfig::
class);
$this->
configureCookie($cookie);
} else { // Session based CSRF protection
$this->
configureSession();
} $this->request = Services::
request();
$this->hashInCookie =
$this->request->
getCookie($this->cookieName
);
$this->
restoreHash();
if ($this->hash === null
) { $this->
generateHash();
}