From 16e4918d4351b2fc6b3a10a8cc37c285d757ed2a Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 12 Aug 2003 07:02:34 +0000 Subject: [PATCH] Little tweak to fix a caching problem. User images were not being cached properly because Moodle was sending a session cookie. I've turned this off now for user images. --- lib/setup.php | 22 ++++++++++++---------- user/pix.php | 2 ++ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/lib/setup.php b/lib/setup.php index 911fb8d8b5..adca64b9ac 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -162,18 +162,20 @@ class object {}; - session_name('MoodleSession'); - @session_start(); - if (! isset($_SESSION['SESSION'])) { - $_SESSION['SESSION'] = new object; - } - if (! isset($_SESSION['USER'])) { - $_SESSION['USER'] = new object; + if (!isset($nomoodlecookie)) { + session_name('MoodleSession'); + @session_start(); + if (! isset($_SESSION['SESSION'])) { + $_SESSION['SESSION'] = new object; + } + if (! isset($_SESSION['USER'])) { + $_SESSION['USER'] = new object; + } + + $SESSION = &$_SESSION['SESSION']; // Makes them easier to reference + $USER = &$_SESSION['USER']; } - $SESSION = &$_SESSION['SESSION']; // Makes them easier to reference - $USER = &$_SESSION['USER']; - if (isset($FULLME)) { $ME = $FULLME; } else { diff --git a/user/pix.php b/user/pix.php index 073ba4c6e9..9792148938 100644 --- a/user/pix.php +++ b/user/pix.php @@ -3,6 +3,8 @@ // Syntax: pix.php/userid/f1.jpg or pix.php/userid/f2.jpg // OR: ?file=userid/f1.jpg or ?file=userid/f2.jpg + $nomoodlecookie = true; // Because it interferes with caching + require_once("../config.php"); $lifetime = 86400; -- 2.39.5