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


PHP cookie::delete方法代碼示例

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


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

示例1: get

 /**
  * Fetch a cookie value, using the Input library.
  *
  * @param   string   cookie name
  * @param   mixed    default value
  * @param   boolean  use XSS cleaning on the value
  * @return  string
  */
 public static function get($name = NULL, $default = NULL, $xss_clean = FALSE)
 {
     // Return an array of all the cookies if we don't have a name
     if ($name === NULL) {
         $cookies = array();
         foreach ($_COOKIE as $key => $value) {
             $cookies[$key] = cookie::get($key, $default, $xss_clean);
         }
         return $cookies;
     }
     if (!isset($_COOKIE[$name])) {
         return $default;
     }
     // Get the cookie value
     $cookie = $_COOKIE[$name];
     // Find the position of the split between salt and contents
     $split = strlen(cookie::salt($name, NULL));
     if (isset($cookie[$split]) and $cookie[$split] === '~') {
         // Separate the salt and the value
         list($hash, $value) = explode('~', $cookie, 2);
         if (cookie::salt($name, $value) === $hash) {
             if ($xss_clean === TRUE and Kohana::config('core.global_xss_filtering') === FALSE) {
                 return Input::instance()->xss_clean($value);
             }
             // Cookie signature is valid
             return $value;
         }
         // The cookie signature is invalid, delete it
         cookie::delete($name);
     }
     return $default;
 }
開發者ID:webmatter,項目名稱:gallery3-contrib,代碼行數:40,代碼來源:cookie.php

示例2: _before_index

 public function _before_index()
 {
     $model = D("MisSystemRecursion");
     $MisSystemCompanyDao = M("mis_system_company");
     $where = array();
     $where['status'] = 1;
     $companylist = $MisSystemCompanyDao->where($where)->select();
     $this->assign("companylist", $companylist);
     //構造結構樹
     $param['url'] = "__URL__/index/jump/jump/parentid/#id#/id/#id#";
     $param['rel'] = "MisSystemCompanyZtree";
     $param['open'] = "true";
     $param['isParent'] = "true";
     if ($companylist) {
         $companyztree = $this->getTree($companylist, $param);
     }
     //高亮默認選中節點
     $parentid = $_REQUEST['parentid'];
     if (empty($parentid)) {
         $parentid = cookie::get("missystemcompanyid");
         cookie::delete("missystemcompanyid");
         if (empty($parentid)) {
             $parentid = $companylist[0]['id'];
         }
     }
     $this->assign('valid', $parentid);
     //賦值用於boolbar
     $this->assign('parentid', $parentid);
     $this->assign("companyztree", $companyztree);
 }
開發者ID:tmlsoft,項目名稱:main,代碼行數:30,代碼來源:MisSystemCompanyAction.class.php

示例3: __construct

 public function __construct(Request $request)
 {
     // Delete the authorization
     cookie::delete('authorized');
     // Redirect to the login page
     $request->redirect(url::site($request->uri(array('controller' => NULL))));
     // Do not call anything here, redirect has already halted execution.
 }
開發者ID:pitchinvasion,項目名稱:monobrow,代碼行數:8,代碼來源:logout.php

示例4: logout

 /**
  * Log a user out and remove any auto-login cookies.
  *
  * @param   boolean  completely destroy the session
  * @return  boolean
  */
 public function logout($destroy)
 {
     if (cookie::get('authautologin')) {
         // Delete the autologin cookie to prevent re-login
         cookie::delete('authautologin');
     }
     return parent::logout($destroy);
 }
開發者ID:plusjade,項目名稱:plusjade,代碼行數:14,代碼來源:ORM.php

示例5: index

 function index()
 {
     //判斷用戶是否是已經登錄狀態
     $data = role::get_manager();
     if ($data['id'] > 0) {
         $data['success'] = 'true';
         $data['msg'] = 1;
     } else {
         $data['success'] = 'false';
         $data['msg'] = 1;
     }
     $username = $this->input->post('username');
     $password = $this->input->post('password');
     $secode = $this->input->post('secode');
     $remember = $this->input->post('remember');
     $data['success'] = 'false';
     //驗證登錄
     $manager = role::log_in($username, $password);
     if (isset($manager['username'])) {
         //判斷普通賬號的狀態、權限
         if (!role::is_root($manager['username'])) {
             if ($manager['active'] != 1) {
                 ulog::login($manager['id'], 1);
                 $data['msg'] = Kohana::lang('o_global.account_was_locked');
             }
             $actions = role::manager_actions($manager['id'], TRUE);
             if (count($actions) < 1) {
                 ulog::login($manager['id'], 2);
                 $data['msg'] = Kohana::lang('o_global.account_permission_enough');
             }
         }
         //是否記錄用戶名
         if ($remember == 1) {
             cookie::set('opococ_username', $username);
         } else {
             cookie::delete('opococ_username');
         }
         //清除記錄登錄錯誤記錄
         //Session::instance()->delete('login_error_count');
         //記入SESSION
         role::set_manager_session($manager);
         //記錄日誌
         ulog::login($manager['id']);
         $data['success'] = 'true';
         $data['msg'] = 1;
         /*if(empty($request_url))
         		{
         			remind::set(Kohana::lang('o_global.login_success'), '/index', 'success');
         		}
                    else
                    {
         			$request_url = url::base() . urldecode($request_url);
         			remind::set(Kohana::lang('o_global.login_success'), $request_url, 'success');
         		}*/
     }
     die(json_encode($data));
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:57,代碼來源:user_login.php

示例6: logout

 /**
  * Logout un utilisateur.
  *
  * @return  void
  */
 public function logout()
 {
     $this->auto_render = FALSE;
     $authentic = Auth::instance();
     if ($authentic->logged_in()) {
         $authentic->logout(TRUE);
     }
     cookie::delete('urlAdminUrl');
     return self::redirection(Kohana::lang('logger.disconnect'));
 }
開發者ID:ezioms,項目名稱:RpgEditor,代碼行數:15,代碼來源:logger.php

示例7: after

 public function after()
 {
     if ($this->auto_render === TRUE and !$this->_ajax) {
         $this->template->content = View::factory('template/admin')->set('content', $this->template->content)->bind('menu', $menu);
         if ($this->_current_user) {
             // Display these menu items as controller
             $menu = array('projects', 'users', 'logout');
         }
     }
     parent::after();
     // Delete any existing message cookie
     cookie::delete('message');
 }
開發者ID:pitchinvasion,項目名稱:monobrow,代碼行數:13,代碼來源:admin.php

示例8: setUp

 /**
  * Setup the test case
  * - Create MySQL users table
  * - Clear any set cookies
  */
 protected function setUp()
 {
     // Use unit test database
     Kohana::config('database')->default['connection']['database'] = "unit_test";
     // Import schema file
     $users_schema = Kohana::find_file('queries/schemas', 'users', 'sql');
     $users_sql = file_get_contents($users_schema);
     try {
         DB::query(Database::INSERT, $users_sql)->execute();
     } catch (Database_Exception $e) {
         echo $e->getMessage();
     }
     cookie::delete('a1_a1_autologin');
 }
開發者ID:vimofthevine,項目名稱:sentry,代碼行數:19,代碼來源:FunctionalTest.php

示例9: getReferer

 public function getReferer()
 {
     $chkCookie = cookie::exists(COOKIE_SPONSOR_NAME);
     if ($chkCookie) {
         $refID = cookie::get(COOKIE_SPONSOR_NAME);
         $validRef = $this->db->count("user_accounts", "agent_id = '{$refID}'");
         if ($validRef != 0) {
             $return = $refID;
         } else {
             cookie::delete(COOKIE_SPONSOR_NAME);
             $return = FALSE;
         }
         return cookie::get(COOKIE_SPONSOR_NAME);
     } else {
         $return = FALSE;
     }
     return $return;
 }
開發者ID:kronxblue,項目名稱:1stg,代碼行數:18,代碼來源:join_model.php

示例10: s

 public function s($sponsor)
 {
     $userData = user::checkExist("user_accounts", "agent_id = '{$sponsor}' or username = '{$sponsor}'");
     if ($userData == 1) {
         $getUserData = $this->db->select("user_accounts", "agent_id, username", "agent_id = '{$sponsor}' or username = '{$sponsor}'", "fetch");
         $chkCookie = cookie::exists(COOKIE_SPONSOR_NAME);
         if ($chkCookie) {
             $cookieName = cookie::get(COOKIE_SPONSOR_NAME);
             if ($cookieName != $getUserData['agent_id']) {
                 cookie::delete(COOKIE_SPONSOR_NAME);
                 cookie::set(COOKIE_SPONSOR_NAME, $getUserData['agent_id'], COOKIE_EXPIRY);
             }
         } else {
             cookie::set(COOKIE_SPONSOR_NAME, $getUserData['agent_id'], COOKIE_EXPIRY);
         }
     } else {
         cookie::delete(COOKIE_SPONSOR_NAME);
     }
     redirect::to(BASE_PATH, TRUE);
 }
開發者ID:kronxblue,項目名稱:1stg,代碼行數:20,代碼來源:r_model.php

示例11: get

 /**
  * Gets the value of a signed cookie. Unsigned cookies will not be returned.
  *
  * @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:ukd1,項目名稱:kohana,代碼行數:29,代碼來源:cookie.php

示例12: logout

 public function logout($destroy)
 {
     // Delete the autologin cookie if it exists
     cookie::get('authautologin') and cookie::delete('authautologin');
     if ($destroy === TRUE) {
         // Destroy the session completely
         Session::instance()->destroy();
     } else {
         // Remove the user object from the session
         unset($_SESSION['auth_user']);
         // Regenerate session_id
         $this->session->regenerate();
     }
     // Double check
     return !isset($_SESSION['auth_user']);
 }
開發者ID:BirenRathod,項目名稱:indicia-code,代碼行數:16,代碼來源:ORM.php

示例13: logout

 /**
  * Log a owner out and remove any auto-login cookies.
  *
  * @param   boolean  completely destroy the session
  * @return  boolean
  */
 public function logout($destroy)
 {
     if ($token = cookie::get('authautologin')) {
         // Delete the autologin cookie to prevent re-login
         cookie::delete('authautologin');
         // Clear the autologin token from the database
         $token = ORM::factory('owner_token', $token);
         if ($token->loaded) {
             $token->delete();
         }
     }
     return parent::logout($destroy);
 }
開發者ID:plusjade,項目名稱:pluspanda-php,代碼行數:19,代碼來源:ORM.php

示例14: logout

 public function logout($destroy = FALSE, $logout_all = FALSE)
 {
     if ($token = cookie::get('authautologin')) {
         echo 999;
         // Delete the autologin cookie to prevent re-login
         cookie::delete('authautologin');
         // Clear the autologin token from the database
         $token = Sprig::factory('token', array('token' => $token))->load();
         if ($token->loaded() and $logout_all) {
             Sprig::factory('token', array('user_id' => $token->user->id))->delete();
         } elseif ($token->loaded()) {
             $token->delete();
         }
     }
     return parent::logout($destroy);
 }
開發者ID:bosoy83,項目名稱:progtest,代碼行數:16,代碼來源:sprig.php

示例15: logout

 /**
  * 登出
  */
 public function logout()
 {
     cookie::delete(COOKIE_KEY);
     redirect('./');
 }
開發者ID:luozhanhong,項目名稱:share,代碼行數:8,代碼來源:login.php


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