本文整理汇总了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);
}