function UserSession::__construct

Same name in other branches
  1. 9 core/lib/Drupal/Core/Session/UserSession.php \Drupal\Core\Session\UserSession::__construct()
  2. 10 core/lib/Drupal/Core/Session/UserSession.php \Drupal\Core\Session\UserSession::__construct()
  3. 11.x core/lib/Drupal/Core/Session/UserSession.php \Drupal\Core\Session\UserSession::__construct()

Constructs a new user session.

Parameters

array $values: Array of initial values for the user session.

1 method overrides UserSession::__construct()
AnonymousUserSession::__construct in core/lib/Drupal/Core/Session/AnonymousUserSession.php
Constructs a new anonymous user session.

File

core/lib/Drupal/Core/Session/UserSession.php, line 76

Class

UserSession
An implementation of the user account interface for the global user.

Namespace

Drupal\Core\Session

Code

public function __construct(array $values = []) {
    foreach ($values as $key => $value) {
        $this->{$key} = $value;
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.