deleteCookie() public method

Deletes a cookie.
public deleteCookie ( $name, $path = NULL, $domain = NULL, $secure = NULL ) : void
return void
Esempio n. 1
0
 /**
  * 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']);
     }
 }
Esempio n. 2
0
 /**
  * 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]);
     }
 }