本文整理匯總了PHP中base::hgetcookie方法的典型用法代碼示例。如果您正苦於以下問題:PHP base::hgetcookie方法的具體用法?PHP base::hgetcookie怎麽用?PHP base::hgetcookie使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類base
的用法示例。
在下文中一共展示了base::hgetcookie方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: is_in_cookie
function is_in_cookie($type, $id)
{
$ids = base::hgetcookie($type);
$already_ids = explode('|', $ids);
if (in_array($id, $already_ids)) {
return true;
}
$this->base->hsetcookie($type, $ids . '|' . $id, 24 * 3600);
return false;
}
示例2: refresh_user
function refresh_user($uid)
{
$sid = base::hgetcookie('sid');
$this->base->user = $this->db->fetch_first("SELECT * FROM " . DB_TABLEPRE . "user u," . DB_TABLEPRE . "usergroup g WHERE u.uid={$uid} AND u.groupid=g.groupid");
$session = $this->db->fetch_first("SELECT referer FROM " . DB_TABLEPRE . "session WHERE sid='" . $sid . "'");
$this->db->query("REPLACE INTO " . DB_TABLEPRE . "session (sid,uid,username,islogin,`time`,referer) VALUES ('{$sid}',{$uid},'" . $this->base->user['username'] . "',1,{$this->base->time},'" . $session['referer'] . "')");
$password = $this->base->user['password'];
$auth = $this->base->authcode("{$uid}\t{$password}", 'ENCODE');
$this->base->hsetcookie('auth', $auth, 24 * 3600 * 365);
}