You are here

function referral_set_cookie in User Referral 5

Same name and namespace in other branches
  1. 6 referral.module \referral_set_cookie()
  2. 7 referral.module \referral_set_cookie()
2 calls to referral_set_cookie()
referral_get in ./referral.module
referral_user in ./referral.module

File

./referral.module, line 272

Code

function referral_set_cookie($uid) {
  $cookie = array(
    'uid' => $uid,
    'timestamp' => time(),
    'ip' => $_SERVER['REMOTE_ADDR'],
    'referer' => $_SERVER['HTTP_REFERER'],
  );
  setcookie(REFERRAL_COOKIE, serialize($cookie), time() + 86400, '/');
}