From 165c418c75899a112a5ae964e5e2a82617d30a11 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 3 Feb 2026 20:51:45 +0000 Subject: [PATCH] Fix CSRF token handling: add session to index.php, fix cookie_secure for HTTPS --- contact-handler.php | 3 +++ index.php | 11 ++++++++++- quote-handler.php | 2 +- quote.php | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/contact-handler.php b/contact-handler.php index 90fab79..b836d4b 100644 --- a/contact-handler.php +++ b/contact-handler.php @@ -1,5 +1,8 @@
-
+ +
diff --git a/quote-handler.php b/quote-handler.php index 757e96c..c5f753d 100644 --- a/quote-handler.php +++ b/quote-handler.php @@ -3,7 +3,7 @@ // Ensure session cookie is available for AJAX requests ini_set('session.cookie_samesite', 'Lax'); ini_set('session.cookie_httponly', '1'); -ini_set('session.cookie_secure', '0'); // Set to '1' if using HTTPS +ini_set('session.cookie_secure', '1'); // Set to '1' if using HTTPS session_start(); // Security headers diff --git a/quote.php b/quote.php index 62a1ee1..237a79f 100644 --- a/quote.php +++ b/quote.php @@ -2,7 +2,7 @@ // Start session before any output ini_set('session.cookie_samesite', 'Lax'); ini_set('session.cookie_httponly', '1'); -ini_set('session.cookie_secure', '0'); // Set to '1' if using HTTPS +ini_set('session.cookie_secure', '1'); // Set to '1' if using HTTPS session_start(); // Enhanced security headers