function SessionManager::startNow
Same name in other branches
- 9 core/lib/Drupal/Core/Session/SessionManager.php \Drupal\Core\Session\SessionManager::startNow()
- 10 core/lib/Drupal/Core/Session/SessionManager.php \Drupal\Core\Session\SessionManager::startNow()
- 11.x core/lib/Drupal/Core/Session/SessionManager.php \Drupal\Core\Session\SessionManager::startNow()
Forcibly start a PHP session.
Return value
bool TRUE if the session is started.
3 calls to SessionManager::startNow()
- SessionManager::regenerate in core/
lib/ Drupal/ Core/ Session/ SessionManager.php - SessionManager::save in core/
lib/ Drupal/ Core/ Session/ SessionManager.php - SessionManager::start in core/
lib/ Drupal/ Core/ Session/ SessionManager.php
File
-
core/
lib/ Drupal/ Core/ Session/ SessionManager.php, line 154
Class
- SessionManager
- Manages user sessions.
Namespace
Drupal\Core\SessionCode
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;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.