当前位置: 首页>>代码示例>>PHP>>正文


PHP Cookie::delete方法代码示例

本文整理汇总了PHP中Cookie::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Cookie::delete方法的具体用法?PHP Cookie::delete怎么用?PHP Cookie::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cookie的用法示例。


在下文中一共展示了Cookie::delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: logout

 public function logout()
 {
     $this->user = null;
     $this->token = null;
     Cookie::delete(self::COOKIE_NAME);
     Session::delete(self::SESSION_NAME);
 }
开发者ID:salomalo,项目名称:php-oxygen,代码行数:7,代码来源:driver.class.php

示例2: run

 public static function run()
 {
     header('Content-type: text/html; charset=utf-8');
     // debug
     Debug::p('PHP Begin');
     $htmlDebug = Request::getGET('htmldebug');
     $ajaxDebug = Request::getGET('ajaxdebug');
     if ($htmlDebug == 'on') {
         Cookie::set('htmldebug', 1);
     }
     if ($htmlDebug == 'off') {
         Cookie::delete('htmldebug');
     }
     if ($ajaxDebug == 'on') {
         Cookie::set('ajaxdebug', 1);
     }
     if ($ajaxDebug == 'off') {
         Cookie::delete('ajaxdebug');
     }
     self::parseUrl();
     $path = empty(self::$CLASS_DIR) ? PROJECT_PATH . '/controller/' . self::$CLASS_NAME . '.class.php' : PROJECT_PATH . '/controller/' . self::$CLASS_DIR . '/' . self::$CLASS_NAME . '.class.php';
     if (!is_file($path)) {
         $userAgent = Arr::get('HTTP_USER_AGENT', $_SERVER, '');
         throw new FrameworkException("控制器:{$path} 不存在!User Agent: {$userAgent}");
     }
     require_once $path;
     $obj = new self::$CLASS_NAME();
     $actionName = self::$ACTION . 'Action';
     $obj->{$actionName}();
     // debug
     Debug::p('PHP End');
     if (isset($_COOKIE['htmldebug']) && !self::$IS_AJAX || isset($_COOKIE['ajaxdebug']) && self::$IS_AJAX) {
         Debug::show();
     }
 }
开发者ID:aozhongxu,项目名称:web_hqoj,代码行数:35,代码来源:Router.class.php

示例3: logout

 /**
  *	@fn logout
  *	@short Action method that logs out a user.
  */
 function logout()
 {
     Cookie::delete('_u');
     Cookie::delete('_uid');
     $this->flash(l('Logout was performed successfully'), 'message');
     $this->redirect_to(array('controller' => 'home'));
 }
开发者ID:emeraldion,项目名称:zelda,代码行数:11,代码来源:login_controller.php

示例4: logout

 /**
  * Logout
  */
 public function logout($params)
 {
     Cookie::delete('login');
     Session::delete('username');
     header('Location: ' . $params['redirect']);
     exit;
 }
开发者ID:hugonicolas,项目名称:Site,代码行数:10,代码来源:User.php

示例5: login_out

 function login_out()
 {
     Cookie::delete('feifa_admin');
     if (empty($_COOKIE['feifa_admin'])) {
         $this->redirect('Admin-Login/index');
     }
 }
开发者ID:xuping123,项目名称:kshop,代码行数:7,代码来源:LoginAction.class.php

示例6: init

 function init($request)
 {
     parent::init($request);
     $ck = new Cookie(COOKIE_NAME_SESSION);
     $ck->delete();
     Request::redirectToModule('index');
 }
开发者ID:ber5ien,项目名称:www.jade-palace.co.uk,代码行数:7,代码来源:Logout.class.php

示例7: logout

 public function logout()
 {
     import('ORG.Util.Cookie');
     //Cookie::set('authcookie', authcode("$user_name\t$user_id\t",'ENCODE'), 31536000);
     Cookie::delete('authcookie');
     return true;
 }
开发者ID:huping112004,项目名称:taobaoke,代码行数:7,代码来源:MemberModel.class.php

示例8: action_logout

 /**
  * Wylogowywanie
  */
 public function action_logout()
 {
     Auth::instance()->logout();
     Session::instance()->destroy();
     Cookie::delete('authautologin');
     exit;
 }
开发者ID:korejwo,项目名称:coc,代码行数:10,代码来源:User.php

示例9: get

	/**
	 * Gets the value of a signed cookie. Cookies without signatures will not
	 * be returned. If the cookie signature is present, but invalid, the cookie
	 * will be deleted.
	 *
	 *     // Get the "theme" cookie, or use "blue" if the cookie does not exist
	 *     $theme = Cookie::get('theme', 'blue');
	 *
	 * @param   string  cookie name
	 * @param   mixed   default value to return
	 * @return  string
	 */
	public static function get($key, $default = NULL)
	{
		if ( ! isset($_COOKIE[$key]))
		{
			// The cookie does not exist
			return $default;
		}

		// Get the cookie value
		$cookie = $_COOKIE[$key];

		// Find the position of the split between salt and contents
		$split = strlen(Cookie::salt($key, NULL));

		if (isset($cookie[$split]) AND $cookie[$split] === '~')
		{
			// Separate the salt and the value
			list ($hash, $value) = explode('~', $cookie, 2);

			if (Cookie::salt($key, $value) === $hash)
			{
				// Cookie signature is valid
				return $value;
			}

			// The cookie signature is invalid, delete it
			Cookie::delete($key);
		}

		return $default;
	}
开发者ID:nevermlnd,项目名称:cv,代码行数:43,代码来源:cookie.php

示例10: setUser

 /**
  * Sets the currently logged in user.
  * @param User $user The user to set.
  * @param string $password The password of the user, just to be sure.
  */
 public static function setUser(User $user, $password)
 {
     // Let's first issue a new session token to null out any old forms
     Session::issueToken();
     // Make sure the user isn't a guest and the password works
     if ($user == null || $user->isGuest() || !$user->isPassword($password)) {
         // Delete the cookies
         Cookie::delete('userid');
         Cookie::delete('sid');
         // Set the user to a guest
         self::$user = User::guest();
         return;
     }
     // Make sure this isn't already the signed in user
     if (self::$user != null && self::$user->getUserId() == $user->getUserId()) {
         return;
     }
     // Set the cookies
     Cookie::set('userid', $user->getUserId());
     Cookie::set('sid', $user->getCookiePassword());
     // Update the user's visit times
     $user->updateVisitInfo();
     // Let's now set the local version
     self::$user = $user;
 }
开发者ID:brandonfrancis,项目名称:scsapi,代码行数:30,代码来源:auth.php

示例11: action_delete

 public function action_delete()
 {
     $name = $this->request->query('name');
     if (Cookie::delete($name)) {
         echo json_decode(array($name => 1));
     }
 }
开发者ID:rhrn,项目名称:apirn,代码行数:7,代码来源:cookie.php

示例12: process

 function process()
 {
     $siteAdmin = $this->needASiteAdminSelected();
     if ($siteAdmin) {
         $choice = $this->request->getConfirmedState();
         $cookieSet = false;
         // is the cookie already set or not?
         if (isset($_COOKIE[COOKIE_NAME_NO_STAT . $siteAdmin])) {
             $cookieSet = true;
         }
         if ($choice == 1) {
             $ck = new Cookie(COOKIE_NAME_NO_STAT . $siteAdmin);
             if ($cookieSet) {
                 $ck->delete();
             } else {
                 $ck->save();
             }
             $this->setMessage();
         } else {
             if ($cookieSet) {
                 $this->tpl->assign("cookie_no_stat", true);
             } else {
                 $this->tpl->assign("cookie_no_stat", false);
             }
         }
     }
 }
开发者ID:ber5ien,项目名称:www.jade-palace.co.uk,代码行数:27,代码来源:AdminSiteCookieExclude.class.php

示例13: action_authorize

 public function action_authorize()
 {
     if ($this->token and $this->token->token !== Arr::get($_GET, 'oauth_token')) {
         // Delete the token, it is not valid
         Cookie::delete($this->cookie);
         // Send the user back to the beginning
         Request::instance()->redirect($this->request->uri(array('action' => 'index')));
     }
     // Get the verifier
     $verifier = Arr::get($_GET, 'oauth_verifier');
     // Store the verifier in the token
     $this->token->verifier($verifier);
     // Exchange the request token for an access token
     $this->token = $this->provider->access_token($this->consumer, $this->token);
     // Store the access token
     Cookie::set($this->cookie, serialize($this->token));
     // At this point, we need to retrieve a unique twitter id for the user.
     $response = OAuth_Request::factory('resource', 'GET', 'http://api.twitter.com/1/account/verify_credentials.json')->param('oauth_consumer_key', Kohana::config('oauth.twitter.key'))->param('oauth_token', $this->token)->sign(OAuth_Signature::factory('HMAC-SHA1'), $this->consumer, $this->token)->execute();
     $response = json_decode($response);
     $twitter_id = $response->screen_name;
     $user = ORM::factory('user')->where('username', '=', $twitter_id)->find();
     !$user->id and Request::instance()->redirect('/auth/confirm?id=' . $twitter_id);
     Auth::instance()->force_login($user);
     Session::instance()->set('notification', 'Succesfully logged in.');
     Request::instance()->redirect('/');
 }
开发者ID:badsyntax,项目名称:2do,代码行数:26,代码来源:oauth.php

示例14: logout

 public function logout()
 {
     Cookie::delete('username');
     Cookie::delete('lastlogintime');
     $this->assign("jumpUrl", "__APP__/index/index");
     $this->success('您已经成功退出,欢迎您的下次登录!');
 }
开发者ID:bigtrees,项目名称:qianxuehui,代码行数:7,代码来源:UserController.class.php

示例15: get

 /**
  * Get cookie value(s)
  * 
  * @param string $name      Name of the cookie to get
  * @param mixed $default    [optional] Default value if cookie is not set. Default is false
  * @return mixed            Cookie stored datas
  */
 public static function get($name, $default = false)
 {
     // handling array notation
     if (preg_match('#^(.*?)\\[(.*?)\\]$#', $name, $m)) {
         if (!isset($_COOKIE[$m[1]][$m[2]])) {
             return $default;
         }
         $value = $_COOKIE[$m[1]][$m[2]];
     } else {
         if (!isset($_COOKIE[$name])) {
             return $default;
         }
         $value = $_COOKIE[$name];
     }
     // retrieve cookie content
     $cookieValue = explode('|', $value);
     // hash is not correct
     if (count($cookieValue) !== 3 || !Security::check($cookieValue[0] . $cookieValue[1], $cookieValue[2])) {
         Cookie::delete($name);
         return $default;
     }
     $value = $cookieValue[0];
     // if content is a serialized array
     if ($v = @unserialize($value)) {
         $value = $v;
     }
     return $value;
 }
开发者ID:salomalo,项目名称:php-oxygen,代码行数:35,代码来源:cookie.class.php


注:本文中的Cookie::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。