Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. NativeSessionStorage.php

function NativeSessionStorage::loadSession

Load the session with attributes.

After starting the session, PHP retrieves the session from whatever handlers are set to (either PHP's internal, or a custom save handler set with session_set_save_handler()). PHP takes the return value from the read() handler, unserializes it and populates $_SESSION with the result automatically.

7 calls to NativeSessionStorage::loadSession()
NativeSessionStorage::clear in vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php
Clear all session data in memory.
NativeSessionStorage::getBag in vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php
Gets a SessionBagInterface by name.
NativeSessionStorage::start in vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php
Starts the session.
PhpBridgeSessionStorage::clear in vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorage.php
Clear all session data in memory.
PhpBridgeSessionStorage::start in vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorage.php
Starts the session.

... See full list

File

vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php, line 391

Class

NativeSessionStorage
This provides a base class for session attribute storage.

Namespace

Symfony\Component\HttpFoundation\Session\Storage

Code

protected function loadSession(?array &$session = null) : void {
    if (null === $session) {
        $session =& $_SESSION;
    }
    $bags = array_merge($this->bags, [
        $this->metadataBag,
    ]);
    foreach ($bags as $bag) {
        $key = $bag->getStorageKey();
        $session[$key] = isset($session[$key]) && \is_array($session[$key]) ? $session[$key] : [];
        $bag->initialize($session[$key]);
    }
    $this->started = true;
    $this->closed = false;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal