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

Breadcrumb

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

function NativeSessionStorage::clear

Overrides SessionStorageInterface::clear

1 method overrides NativeSessionStorage::clear()
PhpBridgeSessionStorage::clear in vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorage.php
Clear all session data in memory.

File

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

Class

NativeSessionStorage
This provides a base class for session attribute storage.

Namespace

Symfony\Component\HttpFoundation\Session\Storage

Code

public function clear() : void {
    // clear out the bags
    foreach ($this->bags as $bag) {
        $bag->clear();
    }
    // clear out the session
    $_SESSION = [];
    // reconnect the bags to the session
    $this->loadSession();
}

API Navigation

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