]> git.mjollnir.org Git - moodle.git/commitdiff
Little tweak to fix a caching problem.
authormoodler <moodler>
Tue, 12 Aug 2003 07:02:34 +0000 (07:02 +0000)
committermoodler <moodler>
Tue, 12 Aug 2003 07:02:34 +0000 (07:02 +0000)
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
user/pix.php

index 911fb8d8b50e01efce534117bfdc3a16481693b7..adca64b9ac17011d1cbbecef853534f24a3aeb57 100644 (file)
 
     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 {
index 073ba4c6e984f1742ccf605e173868122e4a7bb4..979214893864c579f65d6471748387c7f33e8d42 100644 (file)
@@ -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;