Fixed session delete (logout) issues
authorMarcel Werk <burntime@woltlab.com>
Thu, 27 Feb 2014 16:59:12 +0000 (17:59 +0100)
committerMarcel Werk <burntime@woltlab.com>
Thu, 27 Feb 2014 16:59:12 +0000 (17:59 +0100)
wcfsetup/install/files/lib/system/session/SessionHandler.class.php

index 0291590032552f1b3e30c739ad0e7a1ef9cfc8da..14f431a7872df5847db1ad57239f61d69c32d2f1 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 namespace wcf\system\session;
 use wcf\data\user\User;
+use wcf\data\user\UserEditor;
 use wcf\page\ITrackablePage;
 use wcf\system\cache\builder\SpiderCacheBuilder;
 use wcf\system\cache\builder\UserGroupPermissionCacheBuilder;
@@ -559,6 +560,17 @@ class SessionHandler extends SingletonFactory {
         * Deletes this session and it's related data.
         */
        public function delete() {
+               // clear storage
+               if ($this->user->userID) {
+                       self::resetSessions(array($this->user->userID));
+                               
+                       // update last activity time
+                       if (!class_exists('\wcf\system\WCFACP', false)) {
+                               $editor = new UserEditor($this->user);
+                               $editor->update(array('lastActivityTime' => TIME_NOW));
+                       }
+               }
+               
                // set user to guest
                $this->changeUser(new User(null), true);
                
@@ -566,11 +578,6 @@ class SessionHandler extends SingletonFactory {
                $sessionEditor = new $this->sessionEditorClassName($this->session);
                $sessionEditor->delete();
                
-               // clear storage
-               if ($this->user->userID) {
-                       self::resetSessions(array($this->user->userID));
-               }
-               
                // disable update
                $this->disableUpdate();
        }