
抱歉,我不是 Apache 專家。
我需要__Secure
為此 htaccess 行添加前綴:
Header onsuccess edit Set-Cookie (.*) "$1; SameSite=Strict; Secure"
這可能嗎?如何?
答案1
原始回覆
這是否為您提供了所需的資訊:
https://geekflare.com/httponly-secure-cookie-apache/
Apache中的實作過程
確保您已
mod_headers.so
在 Apache HTTP 伺服器中啟用新增以下條目
httpd.conf
:Header always edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure
重啟Apache HTTP伺服器進行測試
更新 2022-12-21 @ 20:58GMT
指導這site 指示的格式為Set-Cookie: __Secure-ID=123; Secure; Domain=example.com; HttpOnly
還關注MDN語法,從你的例子來看,我希望你需要:
Header onsuccess edit Set-Cookie (.*) "__Secure-$1; SameSite=Strict; Secure"
; HttpOnly
您可能還想在最後添加強文字。
Header onsuccess edit Set-Cookie (.*) "__Secure-$1; SameSite=Strict; Secure; HttpOnly"