public function Session::invalidate

Invalidates the current session.

Clears all session attributes and flashes and regenerates the session and deletes the old session from persistence.

@api

Parameters

integer $lifetime Sets the cookie lifetime for the session cookie. A null value: will leave the system settings unchanged, 0 sets the cookie to expire with browser session. Time is in seconds, and is not a Unix timestamp.

Return value

Boolean True if session invalidated, false if error.

Overrides SessionInterface::invalidate

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Session.php, line 164

Class

Session
Session.

Namespace

Symfony\Component\HttpFoundation\Session

Code

public function invalidate($lifetime = null) {
  $this->storage
    ->clear();
  return $this
    ->migrate(true, $lifetime);
}