public function setAsCurrentUser($signalLoader = true, $resetSessionId = true)
    {
        // Get the current variables
        $oldStore = $this->_getVariableStore();

        // When $oldStore is a \Zend_Session_Namespace, then this user is already the current user.
        if (! $this->isCurrentUser()) {
            $this->userLoader->unsetCurrentUser();

            if ($resetSessionId) {
                \Zend_Session::regenerateId();
            }

            $this->_vars = $this->session;

            foreach ($oldStore as $name => $value) {
                $this->_vars->__set($name, $value);
            }

            // Perform the interface switch
            $this->switchLocale();

            if ($signalLoader) {
                $this->userLoader->setCurrentUser($this);
            }
        }

        $this->getCurrentOrganization()->setAsCurrentOrganization();

        return $this;
    }