Always enable virtual sessions
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 30 Sep 2020 14:39:52 +0000 (16:39 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 1 Oct 2020 14:11:28 +0000 (16:11 +0200)
Virtual sessions will be removed shortly, making this commit technically
useless. However it allows us to remove some code paths, allowing this future
commit to be smaller.

wcfsetup/install/files/lib/data/acp/session/ACPSession.class.php
wcfsetup/install/files/lib/data/session/Session.class.php
wcfsetup/install/files/lib/system/session/SessionHandler.class.php

index 5cc9399bf8cacbd0be935e9b58c2e8361ee73199..28ce3e7458b07f73a492ac822d16fb0e2c65f822 100644 (file)
@@ -35,16 +35,6 @@ class ACPSession extends DatabaseObject {
                return false;
        }
        
-       /**
-        * Returns true if this session type supports virtual sessions (sharing the same
-        * session among multiple clients).
-        * 
-        * @return      boolean
-        */
-       public static function supportsVirtualSessions() {
-               return true;
-       }
-       
        /**
         * Returns the existing session object for given user id or null if there
         * is no such session.
index 8974ebf53e92d0a65bdcee79ab90fdd6c4fa5a0e..ead802977b17b179b31ed745dcf098cf945a227e 100644 (file)
@@ -23,11 +23,4 @@ class Session extends ACPSession {
        public static function supportsPersistentLogins() {
                return true;
        }
-       
-       /**
-        * @inheritDoc
-        */
-       public static function supportsVirtualSessions() {
-               return SESSION_ENABLE_VIRTUALIZATION ? true : false;
-       }
 }
index 027131dee02f7f9f0358fe5eddf197a017910ffd..d525051078ee73fd872212d8ec5c3b3ddc84564d 100644 (file)
@@ -117,12 +117,6 @@ class SessionHandler extends SingletonFactory {
         */
        protected $sessionEditorClassName = '';
        
-       /**
-        * virtual session support
-        * @var boolean
-        */
-       protected $supportsVirtualSessions = false;
-       
        /**
         * style id
         * @var integer
@@ -225,7 +219,6 @@ class SessionHandler extends SingletonFactory {
        public function load($sessionEditorClassName, $sessionID) {
                $this->sessionEditorClassName = $sessionEditorClassName;
                $this->sessionClassName = call_user_func([$sessionEditorClassName, 'getBaseClass']);
-               $this->supportsVirtualSessions = call_user_func([$this->sessionClassName, 'supportsVirtualSessions']);
                
                // try to get existing session
                if (!empty($sessionID)) {
@@ -754,11 +747,6 @@ class SessionHandler extends SingletonFactory {
                        // guest -> user (login)
                        //
                        default:
-                               if (!$this->supportsVirtualSessions) {
-                                       // delete all other sessions of this user
-                                       call_user_func([$this->sessionEditorClassName, 'deleteUserSessions'], [$user->userID]);
-                               }
-                               
                                // find existing session for this user
                                $session = call_user_func([$this->sessionClassName, 'getSessionByUserID'], $user->userID);