function referral_set_cookie in User Referral 6
Same name and namespace in other branches
- 5 referral.module \referral_set_cookie()
- 7 referral.module \referral_set_cookie()
2 calls to referral_set_cookie()
File
- ./
referral.module, line 261
Code
function referral_set_cookie($uid) {
$cookie = array(
'uid' => $uid,
'timestamp' => time(),
'ip' => ip_address(),
'referer' => $_SERVER['HTTP_REFERER'],
);
$cookie_lifetime = variable_get('referral_cookie_lifetime', 1) * 86400;
setcookie(REFERRAL_COOKIE, serialize($cookie), time() + $cookie_lifetime, '/');
}