remove() abstract public method

Remove the stored variable item specified by the variable key name from the storage system for current session user.
abstract public remove ( string $key ) : boolean
$key string Variable key name
return boolean Returns true if remove success, otherwise returns false
コード例 #1
0
ファイル: Baidu.php プロジェクト: js-wei/BaiduOpenid
 /**
  * Get the authorization code from the query parameters, if it exists,
  * otherwise return false to signal no authorization code was discoverable.
  *
  * @return mixed Returns the authorization code, or false if the authorization
  * code could not be determined.
  */
 protected function getCode()
 {
     if (isset($_GET['code'])) {
         $this->state = null;
         $this->store->remove('state');
         return $_GET['code'];
     }
 }
コード例 #2
0
ファイル: Baidu.php プロジェクト: naliduo/ThinkSNS
 /**
  * Get the authorization code from the query parameters, if it exists,
  * otherwise return false to signal no authorization code was discoverable.
  *
  * @return mixed Returns the authorization code, or false if the authorization
  * code could not be determined.
  */
 protected function getCode()
 {
     if (isset($_GET['code'])) {
         if ($this->state && $this->state === $_GET['state']) {
             // CSRF state has done its job, so clear it
             $this->state = null;
             $this->store->remove('state');
             return $_GET['code'];
         } else {
             BaiduUtils::errorLog('CSRF state token does not match one provided.');
             return false;
         }
     }
     return false;
 }