You are here

public function NativeSessionStorage::clear in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php \Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage::clear()

Clear all session data in memory.

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 244

Class

NativeSessionStorage
This provides a base class for session attribute storage.

Namespace

Symfony\Component\HttpFoundation\Session\Storage

Code

public function clear() {

  // clear out the bags
  foreach ($this->bags as $bag) {
    $bag
      ->clear();
  }

  // clear out the session
  $_SESSION = array();

  // reconnect the bags to the session
  $this
    ->loadSession();
}