Skip to content

Commit 3376a7c

Browse files
committed
fix: restore removed methods as deprecated
1 parent 11e2297 commit 3376a7c

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

system/Security/Security.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,38 @@ private function saveHashInCookie(): void
538538
$response->setCookieStore($cookieStore);
539539
}
540540

541+
/**
542+
* CSRF Send Cookie
543+
*
544+
* @return false|Security
545+
*
546+
* @deprecated Set cookies to Response object instead.
547+
*/
548+
protected function sendCookie(RequestInterface $request)
549+
{
550+
if ($this->cookie->isSecure() && ! $request->isSecure()) {
551+
return false;
552+
}
553+
554+
$this->doSendCookie();
555+
log_message('info', 'CSRF cookie sent.');
556+
557+
return $this;
558+
}
559+
560+
/**
561+
* Actual dispatching of cookies.
562+
* Extracted for this to be unit tested.
563+
*
564+
* @codeCoverageIgnore
565+
*
566+
* @deprecated Set cookies to Response object instead.
567+
*/
568+
protected function doSendCookie(): void
569+
{
570+
cookies([$this->cookie], false)->dispatch();
571+
}
572+
541573
private function saveHashInSession(): void
542574
{
543575
$this->session->set($this->tokenName, $this->hash);

0 commit comments

Comments
 (0)