From 53d646b5194d78425e43510a7d5e44008601b006 Mon Sep 17 00:00:00 2001 From: Retro_Guy Date: Sat, 20 Jul 2024 08:01:24 -0700 Subject: [PATCH] Try to improve session handling. --- Rocksolid_Light/rocksolid/article-flat.php | 9 +-- Rocksolid_Light/rocksolid/article.php | 1 - Rocksolid_Light/rocksolid/config.inc.php | 11 ++- Rocksolid_Light/rocksolid/index.php | 13 ++- Rocksolid_Light/rocksolid/newsportal.php | 7 +- Rocksolid_Light/rocksolid/overboard.php | 9 +-- Rocksolid_Light/rocksolid/post.php | 93 +++++++++++----------- Rocksolid_Light/rocksolid/search.php | 13 +-- Rocksolid_Light/rocksolid/thread.php | 9 +-- 9 files changed, 81 insertions(+), 84 deletions(-) diff --git a/Rocksolid_Light/rocksolid/article-flat.php b/Rocksolid_Light/rocksolid/article-flat.php index d75fa93..337fee8 100644 --- a/Rocksolid_Light/rocksolid/article-flat.php +++ b/Rocksolid_Light/rocksolid/article-flat.php @@ -1,9 +1,4 @@ 60) { - $_SESSION['last_access'] = time(); -} - header("Expires: " . gmdate("D, d M Y H:i:s", time() + (100)) . " GMT"); header("Cache-Control: max-age=100"); header("Pragma: cache"); @@ -11,6 +6,10 @@ header("Pragma: cache"); include "config.inc.php"; include "$file_newsportal"; +if (! isset($_SESSION['last_access']) || (time() - $_SESSION['last_access']) > 60) { + $_SESSION['last_access'] = time(); +} + $logfile = $logdir . '/newsportal.log'; if (isset($_COOKIE['mail_name'])) { if ($userdata = get_user_mail_auth_data($_COOKIE['mail_name'])) { diff --git a/Rocksolid_Light/rocksolid/article.php b/Rocksolid_Light/rocksolid/article.php index bc659b6..b5101a6 100644 --- a/Rocksolid_Light/rocksolid/article.php +++ b/Rocksolid_Light/rocksolid/article.php @@ -1,5 +1,4 @@ 60) { - $_SESSION['last_access'] = time(); -} - header("Expires: " . gmdate("D, d M Y H:i:s", time() + (30)) . " GMT"); header("Cache-Control: max-age=30"); header("Pragma: cache"); -$_SESSION['isframed'] = 1; - include "config.inc.php"; include ("$file_newsportal"); + +if (! isset($_SESSION['last_access']) || (time() - $_SESSION['last_access']) > 60) { + $_SESSION['last_access'] = time(); +} +$_SESSION['isframed'] = 1; + if (isset($frames_on) && $frames_on === true) { ?>