From 493f548e05ed71c69dd5686d927a2af7fbf5f998 Mon Sep 17 00:00:00 2001 From: Retro_Guy Date: Thu, 10 Jun 2021 06:27:15 +0000 Subject: [PATCH] Add expire setting to auth cookie --- Rocksolid_Light/rocksolid/mail.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Rocksolid_Light/rocksolid/mail.php b/Rocksolid_Light/rocksolid/mail.php index 6e1566e..d7b8797 100644 --- a/Rocksolid_Light/rocksolid/mail.php +++ b/Rocksolid_Light/rocksolid/mail.php @@ -12,6 +12,9 @@ include "newsportal.php"; include "head.inc"; +// How long should cookie allow user to stay logged in? +// 14400 = 4 hours + $auth_expire = 14400; $logged_in = false; if(!isset($_POST['username'])) { $_POST['username'] = $_COOKIE['cookie_name']; @@ -27,7 +30,8 @@ include "head.inc"; if (navigator.cookieEnabled) var authcookie = ""; var savename = ""; - document.cookie = "auth=" + authcookie; + var auth_expire = ""; + document.cookie = "auth="+authcookie+"; max-age="+auth_expire+";"; document.cookie = "cookie_name=" + savename;