AccountSwitcher

An implementation of AccountSwitcherInterface.

This allows for safe switching of user accounts by ensuring that session data for one user is not leaked in to others. It also provides a stack that allows reverting to a previous user after switching.

Hierarchy

File

core/lib/Drupal/Core/Session/AccountSwitcher.php, line 12

Namespace

Drupal\Core\Session

Members

Name Modifiers Type Description
AccountSwitcher::$accountStack protected property A stack of previous overridden accounts.
AccountSwitcher::$currentUser protected property The current user service.
AccountSwitcher::$originalSessionSaving protected property The original state of session saving prior to account switching.
AccountSwitcher::$writeSafeHandler protected property The write-safe session handler.
AccountSwitcher::switchBack public function Reverts to a previous account after switching. Overrides AccountSwitcherInterface::switchBack
AccountSwitcher::switchTo public function Safely switches to another account. Overrides AccountSwitcherInterface::switchTo
AccountSwitcher::__construct public function Constructs a new AccountSwitcher.
doc_Drupal
2016-10-29 08:42:56
Comments
Leave a Comment

Please login to continue.