/** * Destroys all data registered to a session. * @return void */ public function destroy() { if (!self::$started) { throw new Nette\InvalidStateException('Session is not started.'); } session_destroy(); $_SESSION = NULL; self::$started = FALSE; if (!$this->response->isSent()) { $params = session_get_cookie_params(); $this->response->deleteCookie(session_name(), $params['path'], $params['domain'], $params['secure']); } }
/** * Destroy the current session */ public function destroySession() { $this->accessToken = NULL; $this->signedRequest = NULL; $this->user = NULL; $this->session->clearAll(); // Javascript sets a cookie that will be used in getSignedRequest that we need to clear if we can $cookieName = $this->config->getSignedRequestCookieName(); if (array_key_exists($cookieName, $this->httpRequest->getCookies())) { $this->httpResponse->deleteCookie($cookieName, '/', $this->getBaseDomain()); unset($_COOKIE[$cookieName]); } }