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

Breadcrumb

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

function NativeSessionStorage::regenerate

Overrides SessionStorageInterface::regenerate

2 calls to NativeSessionStorage::regenerate()
SessionManager::regenerate in core/lib/Drupal/Core/Session/SessionManager.php
Regenerates id that represents this storage.
SessionManager::regenerate in core/lib/Drupal/Core/Session/SessionManager.php
Regenerates id that represents this storage.
1 method overrides NativeSessionStorage::regenerate()
SessionManager::regenerate in core/lib/Drupal/Core/Session/SessionManager.php
Regenerates id that represents this storage.

File

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

Class

NativeSessionStorage
This provides a base class for session attribute storage.

Namespace

Symfony\Component\HttpFoundation\Session\Storage

Code

public function regenerate(bool $destroy = false, ?int $lifetime = null) : bool {
    // Cannot regenerate the session ID for non-active sessions.
    if (\PHP_SESSION_ACTIVE !== session_status()) {
        return false;
    }
    if (headers_sent()) {
        return false;
    }
    if (null !== $lifetime && $lifetime != \ini_get('session.cookie_lifetime')) {
        $this->save();
        ini_set('session.cookie_lifetime', $lifetime);
        $this->start();
    }
    if ($destroy) {
        $this->metadataBag
            ->stampNew();
    }
    return session_regenerate_id($destroy);
}

API Navigation

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