當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Cookie::remove方法代碼示例

本文整理匯總了PHP中Cookie::remove方法的典型用法代碼示例。如果您正苦於以下問題:PHP Cookie::remove方法的具體用法?PHP Cookie::remove怎麽用?PHP Cookie::remove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Cookie的用法示例。


在下文中一共展示了Cookie::remove方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testUpdates

 public function testUpdates()
 {
     $this->assertEquals(0, count($this->cookie->get_updates()));
     $this->cookie->set('fairy', 'test');
     $updates = $this->cookie->get_updates();
     $this->checkUpdate('fairy', 'test', null, null, null, null, null);
     $this->cookie->set('fairy', 'test', 4, '/', 'phpixie.com', true, true);
     $updates = $this->cookie->get_updates();
     $this->checkUpdate('fairy', 'test', 4, '/', 'phpixie.com', true, true);
     $this->cookie->remove('fairy');
     $this->checkUpdate('fairy', null, -24 * 3600 * 30, null, null, null, null);
 }
開發者ID:scottleedavis,項目名稱:hackazon,代碼行數:12,代碼來源:cookieTest.php

示例2: destroy

 static function destroy($id)
 {
     if (!self::$started) {
         return;
     }
     self::$started = false;
     session_unset();
     //frees the variables (like $_SESSION)
     self::$data->delete();
     self::$data = null;
     Cookie::remove('sessionId');
     Cookie::remove('sessionKey');
 }
開發者ID:jstacoder,項目名稱:brushfire,代碼行數:13,代碼來源:Session.php

示例3: logOut

 /**
  * Logout by removing the Session and Cookies.
  *
  * @access public
  * @param  integer $userId
  * @param  bool    $keepSession
  *
  */
 public function logOut($userId, $keepSession = false)
 {
     Session::remove($keepSession);
     Cookie::remove($userId);
 }
開發者ID:reallysend,項目名稱:miniPHP,代碼行數:13,代碼來源:Login.php

示例4: get

 public static function get()
 {
     $notice = json_decode(Cookie::get(self::$_key));
     Cookie::remove(self::$_key);
     return $notice;
 }
開發者ID:miaokuan,項目名稱:wee,代碼行數:6,代碼來源:Notice.php

示例5: delete

 function delete()
 {
     Cookie::remove($this->key, $this->options);
 }
開發者ID:jstacoder,項目名稱:brushfire,代碼行數:4,代碼來源:EncryptedCookie.php

示例6: __construct

 function __construct($in = false, $cookieMessagesName = false)
 {
     //+	parse input{
     if ($in === false) {
         //apply default
         //+	Handle GET and POST variables{
         $in['get'] = $_SERVER['QUERY_STRING'];
         //we take it from here b/c php will replace characters like '.' and will ignore duplicate keys when forming $_GET
         //can cause script to hang (if no stdin), so don't run if in script unless configured to
         if (!$_ENV['inScript'] || $_ENV['scriptGetsStdin']) {
             //multipart forms can either result in 1. input being blank or 2. including the upload.  In case 1, post vars can be taken from $_POST.  In case 2, need to avoid putting entire file in memory by parsing input
             if (substr($_SERVER['CONTENT_TYPE'], 0, 19) != 'multipart/form-data') {
                 $in['post'] = file_get_contents('php://input');
                 $in['post'] = $in['post'] ? $in['post'] : file_get_contents('php://stdin');
             } elseif ($_POST) {
                 $in['post'] = http_build_query($_POST);
             }
         }
         if ($_SERVER['CONTENT_TYPE'] == 'application/json') {
             $in['post'] = ['json' => json_decode($in['post'])];
         } else {
             $in['post'] = Http::parseQuery($in['post'], $_ENV['pageInPHPStyle']);
         }
         $in['get'] = Http::parseQuery($in['get'], $_ENV['pageInPHPStyle']);
         $this->in = Arrays::merge($in['get'], $in['post']);
         //+	}
     } elseif (is_array($in)) {
         $this->in = $in;
     } else {
         $this->in = Http::parseQuery($in, $_ENV['pageInPHPStyle']);
     }
     $this->originalIn = $this->in;
     if ($_ENV['stripInputContexts']) {
         $this->in = self::removeInputContexts($this->in);
     }
     //+	}
     //+	Handle COOKIE system messages{
     if ($cookieMessagesName === false) {
         //apply default
         $cookieMessagesName = '_PageMessages';
     }
     //Page message are intended to be shown on viewed pages, not ajax responses, so ignore on ajax
     if ($cookieMessagesName && $_COOKIE[$cookieMessagesName] && !$this->in['_ajax']) {
         do {
             $cookie = @unserialize($_COOKIE[$cookieMessagesName]);
             if (is_array($cookie)) {
                 $code = self::saveMessagesCode($cookie['data']);
                 if ($cookie['code'] == $code) {
                     if (is_array($cookie['target'])) {
                         if (!array_diff($cookie['target'], Route::$urlTokens)) {
                             $this->messages = @unserialize($cookie['data']);
                         } else {
                             //not on right page, so break
                             break;
                         }
                     } else {
                         $this->messages = @unserialize($cookie['data']);
                     }
                 }
             }
             Cookie::remove($cookieMessagesName);
         } while (false);
     }
     //+	}
     //load db if configured
     if ($_ENV['database']['default']) {
         $this->db = Db::init(null, $_ENV['database']['default']);
     }
 }
開發者ID:jstacoder,項目名稱:brushfire,代碼行數:69,代碼來源:Control.php


注:本文中的Cookie::remove方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。