当前位置: 首页>>代码示例>>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;未经允许,请勿转载。