2025年6月24日 星期二

Ubuntu 24.04 的 Apache2 設定 Cookies marked as HttpOnly


1.Apache2 啟用 mod_headers.so
$sudo a2enmod headers

2.編輯default-ssl.conf, 設定 HttpOnly;Secure;XSRF
$sudo nano /etc/apache2/sites-available/default-ssl.conf
加入
# HttpOnly;Secure;XSRF
Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure;SameSite=strict


3.重啟 Apache2
$sudo service apache2 restart

4.如何檢測是否設定成功
假設該網站為https://www.example.com
$curl -I https://www.example.com

資料來源:

沒有留言:

張貼留言

只要點兩下,就能將input資料夾內所有PDF進行容量壓縮

系列文章: 01. python 不管何時何地,只要點兩下,資料夾內的所有pdf都會合併成一個pdf https://skjhcreator.blogspot.com/2022/06/pythonpdfpdf.html 02. python 只要點兩下,分別對各資料夾內的pdf合...