You are here

public function Session::invalidate in Zircon Profile 8.0

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

Invalidates the current session.

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

Parameters

int $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

bool True if session invalidated, false if error.

Overrides SessionInterface::invalidate

File

vendor/symfony/http-foundation/Session/Session.php, line 161

Class

Session
Session.

Namespace

Symfony\Component\HttpFoundation\Session

Code

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