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

Breadcrumb

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

function SessionManager::startNow

Forcibly start a PHP session.

Return value

bool TRUE if the session is started.

2 calls to SessionManager::startNow()
SessionManager::save in core/lib/Drupal/Core/Session/SessionManager.php
Force the session to be saved and closed.
SessionManager::start in core/lib/Drupal/Core/Session/SessionManager.php
Starts the session.

File

core/lib/Drupal/Core/Session/SessionManager.php, line 118

Class

SessionManager
Manages user sessions.

Namespace

Drupal\Core\Session

Code

protected function startNow() {
    if ($this->isCli()) {
        return FALSE;
    }
    if ($this->startedLazy) {
        // Save current session data before starting it, as PHP will destroy it.
        $session_data = $_SESSION;
    }
    $result = parent::start();
    // Restore session data.
    if ($this->startedLazy) {
        $_SESSION = $session_data;
        $this->loadSession();
    }
    return $result;
}

API Navigation

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