File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments