/** * CSRF Set Cookie * * @codeCoverageIgnore * @param RequestInterface $request * @return $this */ public function CSRFSetCookie(RequestInterface $request) { $expire = time() + $this->CSRFExpire; $secure_cookie = (bool) $this->cookieSecure; if ($secure_cookie && !$request->isSecure()) { return false; } setcookie($this->CSRFCookieName, $this->CSRFHash, $expire, $this->cookiePath, $this->cookieDomain, $secure_cookie, true); log_message('info', 'CSRF cookie sent'); return $this; }