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


PHP Cookie::Delete方法代碼示例

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


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

示例1: login

 public function login()
 {
     $return = false;
     $sysUser = $this->config->item('sysUser');
     $crudUser = $this->input->post('crudUser', true);
     if (!empty($crudUser) && isset($crudUser['name']) && isset($crudUser['password'])) {
         if ($sysUser['enable'] == true) {
             if ($crudUser['name'] == $sysUser['name'] && $crudUser['password'] == $sysUser['password']) {
                 $auth = array();
                 $auth['user_name'] = $sysUser['name'];
                 $group = array('group_name' => 'SystemAdmin', 'group_manage_flag' => 3, 'group_setting_management' => 1, 'group_global_access' => 1);
                 $auth['group'] = $group;
                 $auth['__system_admin__'] = 1;
                 $this->session->set_userdata('CRUD_AUTH', $auth);
                 $return = true;
             }
         }
         $this->db->select('*');
         $this->db->from('crud_users');
         $this->db->where('user_name', $crudUser['name']);
         $this->db->where('user_password', sha1($crudUser['password']));
         $query = $this->db->get();
         $rs = $query->row_array();
         if (!empty($rs)) {
             $this->db->select('*');
             $this->db->from('crud_groups');
             $this->db->where('id', $rs['group_id']);
             $query = $this->db->get();
             $rs1 = $query->row_array();
             if (!empty($rs1)) {
                 $rs['group'] = $rs1;
             } else {
                 $rs['group'] = array('group_name' => 'None', 'group_manage_flag' => 0, 'group_setting_management' => 0, 'group_global_access' => 0);
             }
             unset($rs['group_id']);
             unset($rs['user_password']);
             unset($rs['user_info']);
             $rs['__system_admin__'] = 0;
             $this->session->set_userdata('CRUD_AUTH', $rs);
             $return = true;
             require_once FCPATH . 'application/third_party/scrud/class/Cookie.php';
             if (isset($_POST['remember_me']) && (int) $_POST['remember_me'] == 1) {
                 Cookie::Set('CRUD_AUTH', serialize(array(base64_encode($crudUser['name']), base64_encode(sha1($crudUser['password'])))), Cookie::SevenDays);
             } else {
                 Cookie::Delete('CRUD_AUTH');
             }
         }
     }
     return $return;
 }
開發者ID:Dannyngs,項目名稱:chinese_med,代碼行數:50,代碼來源:admin_common.php

示例2: logout

 public function logout()
 {
     Cookie::Delete('id');
     Cookie::Delete('hash');
     return true;
 }
開發者ID:stevemcquaid,項目名稱:mitm-grabb3r,代碼行數:6,代碼來源:Login.class.php

示例3: Logout

 function Logout()
 {
     if (Cookie::Delete('id')) {
         HTTP::RedirectLocal();
         return true;
     } else {
         return false;
     }
 }
開發者ID:etienne,項目名稱:jam,代碼行數:9,代碼來源:User.php


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