• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_cookie函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_cookie函数的典型用法代码示例。如果您正苦于以下问题:PHP get_cookie函数的具体用法?PHP get_cookie怎么用?PHP get_cookie使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: editAction

 public function editAction()
 {
     $department_id = fpBase('http')->getParam('department_id');
     if (!empty($department_id)) {
         $result = M('department')->find('pid=' . intval($department_id));
         if ($result) {
             exit(json_encode(array('statusCode' => 300, 'message' => '错误选择,选择的部门还有下级,请选择所在部门')));
         }
     }
     $uid = fpBase('http')->getParam('id');
     $user = M('user')->find('id=' . intval($uid));
     if (!empty($user)) {
         $dep = M('department')->getSelect($user['department_id']);
     } else {
         exit(json_encode(array('statusCode' => 300, 'message' => '用户不存在')));
     }
     $password = fpBase('http')->getPost('password');
     if (empty($password)) {
         unset($_POST['password']);
     } else {
         $_POST['password'] = md5($_POST['password']);
     }
     if (fpBase('http')->isPost()) {
         fpBase('cache')->write('user_uid_' . get_cookie('uid'), null);
     }
     $this->assign('dep', $dep);
     parent::editAction();
 }
开发者ID:jeremywong1992,项目名称:companyBook,代码行数:28,代码来源:userController.php


示例2: __construct

 function __construct()
 {
     $this->ci =& get_instance();
     $this->ci->load->database();
     $this->ci->load->config('linkedin_oauth', TRUE);
     $this->ci->load->config('users', TRUE);
     $this->ci->load->library('ion_auth');
     $this->ci->load->library('session');
     $this->ci->load->library('form_validation');
     $this->ci->load->library('input');
     $this->ci->load->helper('image/image_resize');
     $this->ci->load->helper('logger');
     $this->ci->load->helper('linkedin/linkedin_api');
     $this->ci->load->model('linkedin/linkedin_model');
     $this->ci->load->model('invitation_model');
     $this->ci->load->model('preferences_model');
     $this->ci->load->model('user_model');
     $this->ci->load->model('user_rating_model');
     $this->ci->load->model('user_lunch_wishlist_model');
     $this->ci->load->model('user_lunch_buddy_model');
     $this->ci->load->model('user_profile_model');
     // Set Config
     $this->component_class = $this->ci->config->item('component_class', 'ls_notifications');
     //auto-login the user if they are remembered
     if (!$this->ci->ion_auth->logged_in() && get_cookie('identity') && get_cookie('remember_code')) {
         $this->ci->ion_auth = $this;
         $this->ci->ion_auth_model->login_remembered_user();
     }
     $this->ci->ion_auth_model->trigger_events('library_constructor');
 }
开发者ID:laiello,项目名称:skrapshcnul,代码行数:30,代码来源:ls_preferences.php


示例3: _init

	/**
	 * Initialise User Library
	 *
	 * Several jobs to perform
	 * > Check for autologin
	 * > Delete un activated user accounts
	 *
	 * @access private
	 */
	function _init()
	{
		// Log the user in if autologin details are correct
		if( !$this->is_user())
		{
			if (FALSE !== ($autologin = get_cookie('autologin')))
			{
				// Autologin data exists
				$autologin = unserialize($autologin);

				// Check its valid
				$result = $this->CI->user_model->validateLogin($autologin['login_field'],$autologin['password']);
				if($result['valid'])
				{
					// Log user in
					$this->set_userlogin($autologin['id']);
					log_message('debug','BackendPro->Userlib->_init : User logged in using autologin cookie');
				}
			}
		}

		// Remove any user accounts which have not been activated
		// within the specified deadline
		$query = $this->CI->user_model->delete('Users','DATE_ADD(created,INTERVAL '.$this->CI->preference->item('account_activation_time').' DAY) <= NOW() AND active=0');
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:34,代码来源:Userlib.php


示例4: enter

 public function enter()
 {
     $id = get_cookie("slave_game_user_id");
     if ($id == NULL) {
         // create new user
         $this->load->view('index', []);
         return;
     }
     $query = $this->db->get_where('user', array('id' => $id));
     $data = $query->row();
     switch ($data->state) {
         case 7:
             $this->still_cool($id);
         case 1:
         case 2:
             $this->load->view("owner/palace", ['user' => $data]);
             break;
         case 3:
         case 4:
         case 5:
             $this->load->view("slave/square", ['user' => $data, 'owner_name' => $this->get_current_owner($id)]);
             break;
         case 6:
             if ($this->still_cool($id)) {
                 $this->load->view("slave/jail", ['user' => $data]);
             } else {
                 $this->load->view("slave/square", ['user' => $data, 'owner_name' => $this->get_current_owner($id)]);
             }
             break;
         default:
             break;
     }
 }
开发者ID:speedscorpion,项目名称:slave_proj,代码行数:33,代码来源:Player.php


示例5: view

 public function view($page = 'home')
 {
     $this->load->model('api_model');
     $this->load->database();
     if (!file_exists(APPPATH . '/views/pages/' . $page . '.php')) {
         // Whoops, we don't have a page for that!
         die("<center><font face=tahoma><div dir=rtl>صفحه مورد نظر پیدا نشد.");
     }
     if ($page == "api") {
         $data['title'] = ucfirst($page);
         // Capitalize the first letter
         $this->load->view('pages/' . $page, $data);
         return;
     }
     $data['title'] = ucfirst($page);
     // Capitalize the first letter
     $this->load->view('templates/header', $data);
     if (null != get_cookie("username") && null != get_cookie("password") && null != get_cookie("name") && null != get_cookie("id")) {
         $u = get_cookie("username");
         $p = get_cookie("password");
         $query = $this->db->query("SELECT * FROM user WHERE email = '" . $u . "'  AND sha1(password)='" . $p . "'");
         if ($query->num_rows() < 1) {
             delete_cookie("username");
         }
         $this->load->view('pages/' . $page, $data);
     } else {
         $this->load->view('pages/home-nologin', $data);
     }
     $this->load->view('templates/footer', $data);
 }
开发者ID:arashrasoulzadeh,项目名称:gameID,代码行数:30,代码来源:Pages.php


示例6: L

/**
 * 语言文件处理
 *
 * @param    string $language 标示符
 * @param    array $pars      转义的数组,二维数组 ,'key1'=>'value1','key2'=>'value2',
 * @param    string $apps     多个模块之间用半角逗号隔开,如:member,guestbook
 * @return    string        语言字符
 */
function L($language = 'empty language', $pars = array(), $apps = '')
{
    static $LANG = array();
    static $LANG_APPS = array();
    static $lang = '';
    $language = str_replace(' ', '_', $language);
    $lang = get_cookie('lang') ? get_cookie('lang') : LANG;
    if (!$LANG) {
        require_once COREFRAME_ROOT . 'languages' . '/' . $lang . '/system.lang.php';
        if (file_exists(COREFRAME_ROOT . 'languages' . '/' . $lang . '/' . M . '.lang.php')) {
            require_once COREFRAME_ROOT . 'languages' . '/' . $lang . '/' . M . '.lang.php';
        }
    }
    if (!empty($apps)) {
        $apps = explode(',', $apps);
        foreach ($apps as $app) {
            if (!isset($LANG_APPS[$app])) {
                require_once COREFRAME_ROOT . 'languages' . '/' . $lang . '/' . $app . '.lang.php';
            }
        }
    }
    if (!array_key_exists($language, $LANG)) {
        return $language;
    } else {
        $language = $LANG[$language];
        if ($pars) {
            foreach ($pars as $_k => $_v) {
                $language = str_replace('{' . $_k . '}', $_v, $language);
            }
        }
        return $language;
    }
}
开发者ID:haizhilin2013,项目名称:wuzhicms,代码行数:41,代码来源:common.func.php


示例7: manage

 public function manage()
 {
     $where = '';
     $keywords = '';
     $cid = intval($GLOBALS['cid']);
     if (isset($GLOBALS['keywords'])) {
         if (strtolower(CHARSET) == 'gbk') {
             $keywords = iconv('utf-8', 'gbk', $GLOBALS['keywords']);
         } else {
             $keywords = $GLOBALS['keywords'];
         }
         $keywords = sql_replace($keywords);
         $GLOBALS['keytype'] = 'keywords';
     }
     $show_dialog = 1;
     $form = load_class('form');
     $siteid = get_cookie('siteid');
     $r = $this->db->get_one('category', array('cid' => $cid));
     $where = array('keyid' => M, 'siteid' => $siteid, 'language' => $r['language']);
     $categorys = $this->db->get_list('category', $where, '*', 0, 200, 0, '', '', 'cid');
     foreach ($categorys as $_cid => $_value) {
         if ($_cid == $cid) {
             $categorys[$_cid]['selected'] = 'selected';
         }
     }
     include $this->template('relation_manage');
 }
开发者ID:nilm,项目名称:wuzhicms,代码行数:27,代码来源:relation.php


示例8: setFlow

 function setFlow()
 {
     $this->load->database();
     //存入cookie中
     $this->load->helper('cookie');
     $yk_id = get_cookie('id');
     //获取游客id
     set_cookie('flow', '100M');
     $count = $this->db->where('id', $yk_id)->from('user_session')->count_all_results();
     //插入之前先查查游客表该游客是否被记录了
     $session_data = array('id' => $yk_id, 'flow' => '100M');
     if ($count > 0) {
         //游客已经存入表中,只是更新
         unset($session_data['id']);
         $this->db->where('id', $yk_id)->update('user_session', $session_data);
     } else {
         $this->db->insert('user_session', $session_data);
     }
     $username = $this->session->userdata['username'];
     if ($username) {
         //如果用户已经注册,则还要存入用户表
         $this->db->where('username', $username)->update('userinfo', array('flow' => '100M'));
     }
     echo 'success';
 }
开发者ID:cygjs100crew,项目名称:cygjs_fr,代码行数:25,代码来源:Welcome.php


示例9: index

 public function index()
 {
     // global variable fungsi.
     $data = [];
     // ambil value untuk variable view.
     $data = $this->getVariable();
     // jika data login sudah ada. redirect lgsg.
     $userRole = '';
     // ambil peran user dulu.
     if ($this->session->userdata('userLogin') != '') {
         $userRole = $this->model_user->getUserDatum('peran', 'id', $this->session->userdata('userLogin'));
     } else {
         if (get_cookie('userLogin', true) != '') {
             $userRole = $this->model_user->getUserDatum('peran', 'id', get_cookie('userLogin', true));
         }
     }
     // jika peran user adalah admin.
     if ($userRole == 'admin_bau') {
         redirect('keuangan');
     } else {
         if ($userRole == 'dosen_chiefbau') {
             redirect('laporan');
         }
     }
     // load view.
     $this->load->view('includes/header_bau', $data);
     $this->load->view('nav/navbar_bau');
     $this->load->view('bau_placeholder');
     $this->load->view('includes/footer_bau', $data);
 }
开发者ID:RogueZero,项目名称:SDP2015,代码行数:30,代码来源:bau.php


示例10: space_count

 public function space_count()
 {
     $uid = (int) $this->input->get('uid');
     if ($this->uid && $uid && $this->uid != $uid) {
         // 记录访客信息
         $name = 'space-count-' . $this->uid . '-' . $uid;
         if (get_cookie($name)) {
             // 缓存期
         } else {
             // 查询今天是否访问过
             if ($this->db->where('uid', $this->uid)->where('spaceid', $uid)->where('DATEDIFF(from_unixtime(inputtime),now())=0')->count_all_results('space_access')) {
                 $this->db->where('uid', $this->uid)->where('spaceid', $uid)->update('space_access', array('inputtime' => SYS_TIME));
             } else {
                 $this->db->insert('space_access', array('uid' => $this->uid, 'spaceid' => $uid, 'content' => '', 'username' => $this->member['username'], 'inputtime' => SYS_TIME));
             }
             set_cookie($name, SYSTIME, 300);
             // 5分钟统计一次
         }
     }
     // 验证空间权限
     if ($this->_space_show($uid)) {
         $callback = isset($_GET['callback']) ? $_GET['callback'] : 'callback';
         exit($callback . '(' . json_encode(array('url' => dr_member_url('api/access', array('uid' => $uid)))) . ')');
     }
     exit('');
 }
开发者ID:Thebeautifullife,项目名称:yichunchengguan,代码行数:26,代码来源:Api.php


示例11: login

 public function login()
 {
     $this->load->model('user_model', 'User');
     $this->load->model('application_model', 'Application');
     if (get_cookie("eventribe-remember-token") != "") {
         $login = $this->User->get_user_from_token(get_cookie("eventribe-remember-token"));
         $this->session->set_userdata("user", $login);
         redirect(base_url() . 'router/org_picker/' . $login);
     } else {
         $this->form_validation->set_rules('username', 'Username', 'required|min_length[5]|max_length[250]');
         $this->form_validation->set_rules('password', 'Password', 'required|min_length[5]|max_length[250]');
         //run validation
         if ($this->form_validation->run() == FALSE) {
             $this->session->set_flashdata('errors', validation_errors());
             redirect(base_url());
         } else {
             $login = $this->User->login($this->input->post('username'), $this->input->post('password'));
             if ($login != "" && $login != "invalid login parameters") {
                 $this->session->set_userdata("user", $login);
                 $this->session->set_userdata("username", $this->input->post("username"));
                 $this->session->set_userdata("password", $this->input->post("password"));
                 if ($this->input->post("remember") == 1) {
                     $token = $this->User->set_remember_me($this->input->post("username"), $this->input->post("password"));
                     $expire = time() + 2678400;
                     $cookie = array('name' => 'eventribe-remember-token', 'value' => $token, 'expire' => $expire, 'secure' => TRUE);
                     set_cookie($cookie);
                 }
                 redirect(base_url() . 'router/org_picker/' . $login);
             } else {
                 $this->session->set_flashdata('errors', $login);
                 redirect(base_url());
             }
         }
     }
 }
开发者ID:Omar-Faramawi,项目名称:codeigniter-eventrib-project,代码行数:35,代码来源:router.php


示例12: index

	function index(){
		//codeArmy v1.0
		if($this->session->userdata('username')) redirect('my-profile');
		$this->view_data['window_title'] = "CodeArmy | Home";
		$this->view_data['window_title'] = get_cookie('remember_me_token');
		$this->load->view('home_codearmy_view', $this->view_data);
	}
开发者ID:raminv80,项目名称:CodeArmy,代码行数:7,代码来源:home.php


示例13: update

 public function update($keyid, $posids, $datas, $cid = 0)
 {
     //$this->id.'-'.$this->cid
     if ($posids == '') {
         return true;
     }
     $formdata = $tmp = '';
     foreach ($datas as $key => $value) {
         if (in_array($key, array('title', 'thumb', 'url', 'remark', 'addtime', 'status'))) {
             $formdata[$key] = $value;
         } else {
             $tmp[$key] = $value;
         }
     }
     if (!empty($tmp)) {
         $formdata['attach'] = serialize($tmp);
     }
     $posid_str = implode(',', $posids);
     $this->db->delete('block_data', "`keyid`='{$keyid}' AND `blockid` NOT IN({$posid_str})");
     $siteid = get_cookie('siteid');
     foreach ($posids as $blockid) {
         if ($this->db->get_one('block_data', array('keyid' => $keyid, 'blockid' => $blockid))) {
             $formdata['blockid'] = $blockid;
             $this->db->update('block_data', $formdata, array('keyid' => $keyid, 'blockid' => $blockid));
         } else {
             $formdata['keyid'] = $keyid;
             $formdata['siteid'] = $siteid;
             $formdata['cid'] = $cid;
             $formdata['blockid'] = $blockid;
             $formdata['sort'] = '50';
             $this->db->insert('block_data', $formdata);
         }
     }
 }
开发者ID:another3000,项目名称:wuzhicms,代码行数:34,代码来源:block_api.class.php


示例14: edit

 /**
  * 修改公告
  */
 public function edit()
 {
     $id = intval($GLOBALS['id']);
     if (isset($GLOBALS['submit'])) {
         $formdata = $GLOBALS['form'];
         $formdata['title'] = remove_xss($formdata['title']);
         $formdata['note'] = remove_xss($formdata['note']);
         $formdata['addtime'] = SYS_TIME;
         $formdata['endtime'] = strtotime($GLOBALS['endtime']);
         $formdata['publisher'] = get_cookie('username');
         $formdata['css'] = 'color:#' . remove_xss(ltrim($GLOBALS['title_css'], '#') . ';' . $GLOBALS['font_weight']);
         $linkageid = $this->db->update('affiche', $formdata, array('id' => $id));
         MSG(L('operation success'), '?m=affiche&f=index&v=listing' . $this->su());
     } else {
         $show_formjs = 1;
         $form = load_class('form');
         load_function('admin');
         $endtime = SYS_TIME + 86400 * 30;
         $endtime = date('Y-m-d');
         $r = $this->db->get_one('affiche', array('id' => $id));
         $styles = style($r['css']);
         //color:#ff0000;font-weight:bold
         $font_weight = $styles['font-weight'];
         $color = $styles['color'];
         include $this->template('edit');
     }
 }
开发者ID:another3000,项目名称:wuzhicms,代码行数:30,代码来源:index.php


示例15: index

 public function index()
 {
     if (IS_POST) {
         if (get_cookie('admin_login')) {
             $this->admin_msg(lang('167'));
         }
         if (SITE_ADMIN_CODE && !$this->check_captcha('code')) {
             $this->admin_msg(lang('168'));
         }
         $uid = $this->member_model->admin_login($this->input->post('username', TRUE), $this->input->post('password', TRUE));
         if ($uid > 0) {
             $url = $this->input->get('backurl') ? urldecode($this->input->get('backurl')) : dr_url('home');
             $url = pathinfo($url);
             $url = $url['basename'] ? $url['basename'] : dr_url('home/index');
             $this->admin_msg(lang('042'), $url, 1);
         }
         if ($uid == -1) {
             $this->admin_msg(lang('043'));
         } elseif ($uid == -2) {
             $this->admin_msg(lang('044'));
         } elseif ($uid == -3) {
             $this->admin_msg(lang('045'));
         } elseif ($uid == -4) {
             $this->admin_msg(lang('046'));
         } else {
             $this->admin_msg(lang('047'));
         }
     }
     $this->template->assign('username', $this->member['username']);
     $this->template->display('login.html');
 }
开发者ID:xxjuan,项目名称:php-coffee,代码行数:31,代码来源:Login.php


示例16: index

 public function index()
 {
     if (($mail = get_cookie('mail')) && ($hashPass = get_cookie('pass'))) {
         echo $mail;
         echo $hashPass;
         if ($this->UserModel->validate_login($mail, $hashPass)) {
             $this->do_connection($mail);
         }
     }
     if ($this->session->role == self::$atm_role_nom) {
         redirect(base_url() . 'Atm_home');
     } else {
         if ($this->session->role == self::$groupe_role_nom) {
             redirect(base_url() . 'Groupe_home');
         }
     }
     $data['submit_label'] = $this->lang->line('Connection');
     $data['title'] = $this->lang->line('Connection');
     $data['mail_label'] = $this->lang->line('Email Address');
     $data['pass_label'] = $this->lang->line('Password');
     $data['form_target'] = base_url() . 'Login/connect';
     $data['rememberMe'] = $this->lang->line('Remember me');
     $data['ou_label'] = $this->lang->line('Or');
     $data['signup_label'] = strtolower($this->lang->line('Sign up'));
     $data['login_exists_error_label'] = $this->login_exists_error_label;
     $data['wrong_password_error_label'] = $this->wrong_password_error_label;
     $this->load->view('header', $data);
     $this->load->view('login', $data);
     $this->load->view('footer', $data);
 }
开发者ID:cadoman,项目名称:prolog,代码行数:30,代码来源:Login.php


示例17: index

 /**
  * 执行任务和队列
  */
 public function index()
 {
     // 第三方执行队列时,非命令行不执行
     if (SYS_CRON_QUEUE && !(PHP_SAPI === 'cli' || defined('STDIN'))) {
         exit;
     }
     // 自动更新模块缓存(3小时一次)
     $file = FCPATH . 'cache/auto.log';
     $auto = is_file($file) ? (int) file_get_contents($file) : 0;
     if (!$auto || $auto <= SYS_TIME - 10800) {
         $this->clear_cache('module');
         file_put_contents($file, SYS_TIME);
     }
     // 未到发送时间
     if (get_cookie('cron')) {
         exit;
     }
     // 一次执行的任务数量
     $pernum = defined('SYS_CRON_NUMS') && SYS_CRON_NUMS ? SYS_CRON_NUMS : 10;
     // 用户每多少秒调用本程序
     set_cookie('cron', 1, SYS_CRON_TIME);
     // 查询所有队列记录
     $queue = $this->db->order_by('status ASC,id ASC')->limit($pernum)->get('cron_queue')->result_array();
     if (!$queue) {
         // 所有任务执行完毕
         $this->db->query('TRUNCATE `' . $this->db->dbprefix('cron_queue') . '`');
         exit;
     }
     foreach ($queue as $data) {
         $this->cron_model->execute($data);
     }
     // 本次任务执行完毕
     exit;
 }
开发者ID:xxjuan,项目名称:php-coffee,代码行数:37,代码来源:Cron.php


示例18: index

 public function index()
 {
     // remove old session off this system
     //$this->session->unset_userdata('GpID');
     //$this->session->unset_userdata('StID');
     $this->session->unset_userdata('HOME');
     $this->session->unset_userdata('URL');
     $this->session->unset_userdata('MnID');
     $this->session->unset_userdata('MnURL');
     $this->session->unset_userdata('MnNameT');
     $this->session->unset_userdata('SysName');
     if ($this->checkUser()) {
         // Have Session data
         $data['permission'] = $this->m_umusergroup->get_gear()->result_array();
         $data['system'] = $this->m_umusergroup->get_system()->result_array();
         /*$date = array();
         		foreach($data['system'] as $system){
         			$data['temp'] = $system['GpIcon'];
         			$this->m_umicon->IcName = $data['temp'];
         			$temp = $this->m_umicon->get_date_by_name()->result_array();
         		}
         		}*/
         $data['save'] = explode("?", get_cookie('gear' . $this->session->userdata('UsID')));
         //$data['save'] = explode("?",$this->session->userdata('save')); old version get savedata from session
         /*foreach($data['save'] as $loop)
         		{
         			echo $loop;
         		} for debugging*/
         $this->output('Gear/Gear', $data);
     } else {
         $this->login();
         //redirect('https://'.base_url().'/index.php/gear/login','refresh');
     }
 }
开发者ID:hds-team,项目名称:HDS,代码行数:34,代码来源:gear.php


示例19: in

 function in()
 {
     $this->load->library('form_validation');
     $this->form_validation->set_rules(array(array('field' => 'mb_id', 'label' => '아이디', 'rules' => 'trim|required|min_length[3]|max_length[20]|alpha_dash|xss_clean'), array('field' => 'mb_password', 'label' => '비밀번호', 'rules' => 'trim|required|md5')));
     if ($this->form_validation->run() !== FALSE) {
         $this->load->library('encrypt');
         $mb = $this->Basic_model->get_member($this->input->post('mb_id'), 'mb_id, mb_password, mb_email, mb_leave_date, mb_email_certify');
         if (!$mb || $this->input->post('mb_password') !== $this->encrypt->decode($mb['mb_password'])) {
             goto_url('member/login/qry/1');
         }
         if ($mb['mb_leave_date'] && $mb['mb_leave_date'] <= date('Ymd', time())) {
             $date = preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})/", "\\1년 \\2월 \\3일", $mb['mb_leave_date']);
             alert("탈퇴한 아이디이므로 접근하실 수 없습니다.\\n\\n탈퇴일 : " . $date);
         }
         if ($this->config->item('cf_use_email_certify') && !preg_match("/[1-9]/", $mb['mb_email_certify'])) {
             alert("메일인증을 받으셔야 로그인 하실 수 있습니다.\\n\\n회원님의 메일주소는 " . $mb['mb_email'] . " 입니다.");
         }
         $this->session->set_userdata('ss_mb_id', $mb['mb_id']);
         if ($this->input->post('reId')) {
             $cookie = array('name' => 'ck_mb_id', 'value' => $mb['mb_id'], 'expire' => 86400 * 30, 'domain' => $this->config->item('cookie_domain'));
             set_cookie($cookie);
         } else {
             if (get_cookie('ck_mb_id')) {
                 delete_cookie('ck_mb_id');
             }
         }
         goto_url($this->input->post('url'));
     }
     goto_url('/');
 }
开发者ID:ubiopen,项目名称:KI_Board,代码行数:30,代码来源:login.php


示例20: __construct

 public function __construct()
 {
     try {
         parent::__construct();
         $user_id = $this->session->userdata("user_id");
         $token = get_cookie("mjq_user_token");
         $this->load->model("mod_login");
         if (isset($token)) {
             $gettoken = $this->mod_login->gettoken($token);
             $gettoken = $gettoken->result_array();
             if (count($gettoken == 1) && !isset($user_id)) {
                 $usersession = array("user_id" => $gettoken[0]["id"], "user_fullname" => $gettoken[0]["fullname"]);
                 $this->session->set_userdata($usersession);
                 $user_id = $this->session->userdata("user_id");
             }
         }
         if (!isset($user_id)) {
             redirect("login/index", "refresh");
             if (isset($token)) {
                 delete_cookie("mjq_user_token");
             }
         }
         $this->load->view("admin/header");
     } catch (Exception $e) {
         redirect("login/index", "refresh");
     }
 }
开发者ID:vuthea,项目名称:mjqpro,代码行数:27,代码来源:Admin.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_core_checksums函数代码示例发布时间:2022-05-15
下一篇:
PHP get_contexts_by_capability_for_user函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap