[geeklog-hg] geeklog: Fixed problem of anonymous user sessions being deleted ...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Thu Oct 4 11:35:51 EDT 2012


changeset 8852:26f0562f9c88
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/26f0562f9c88
user: Tom <websitemaster at cogeco.net>
date: Thu Oct 04 11:33:30 2012 -0400
description:
Fixed problem of anonymous user sessions being deleted from the sessions table when a new anonymous session is created

diffstat:

 system/lib-sessions.php |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r be4b706d5dde -r 26f0562f9c88 system/lib-sessions.php
--- a/system/lib-sessions.php	Tue Oct 02 09:46:32 2012 -0400
+++ b/system/lib-sessions.php	Thu Oct 04 11:33:30 2012 -0400
@@ -325,7 +325,12 @@
     $expirytime = (string) (time() - $lifespan);
     if (!isset($_COOKIE[$_CONF['cookie_session']])) {
         // ok, delete any old sessons for this user
-        DB_delete($_TABLES['sessions'], 'uid', $userid);
+        if ($userid > 1) {
+            DB_delete($_TABLES['sessions'], 'uid', $userid);
+        } else {
+            DB_delete($_TABLES['sessions'], array('uid', 'remote_ip'),
+                                            array(1, $remote_ip));
+        }
     } else {
         $deleteSQL = "DELETE FROM {$_TABLES['sessions']} WHERE (start_time < $expirytime)";
         $delresult = DB_query($deleteSQL);
@@ -339,11 +344,10 @@
             die("Delete failed in new_session()");
         }
     }
-    // Remove the anonymous sesssion for this user
+    // Remove the anonymous session for this user
     if ($userid > 1) {
         // Retrieve any session variables that we need to add to the new logged in session
         // To come
-        
         // Delete record
         DB_delete($_TABLES['sessions'], array('uid', 'remote_ip'),
                                         array(1, $remote_ip));



More information about the geeklog-cvs mailing list