]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
marker in sessions
authorEvan Prodromou <evan@controlyourself.ca>
Sat, 27 Jun 2009 12:07:14 +0000 (05:07 -0700)
committerEvan Prodromou <evan@controlyourself.ca>
Sat, 27 Jun 2009 12:07:14 +0000 (05:07 -0700)
lib/util.php

index f6d50b18074be35f8729ae3410ed2f6fbe30c44b..e5a8eaea06250438a0299256507a77988793c860 100644 (file)
@@ -139,8 +139,19 @@ function common_have_session()
 
 function common_ensure_session()
 {
+    $c = null;
+    if (array_key_exists(session_name, $_COOKIE)) {
+        $c = $_COOKIE[session_name()];
+    }
     if (!common_have_session()) {
         @session_start();
+        if (!isset($_SESSION['started'])) {
+            $_SESSION['started'] = time();
+            if (!empty($c)) {
+                common_log(LOG_WARNING, 'Session cookie "' . $_COOKIE[session_name()] . '" ' .
+                           ' is set but started value is null');
+            }
+        }
     }
 }