You are here

function ad_session_start in Advertisement 7.3

@file Code for the ad cookie tracking.

1 call to ad_session_start()
ad_get_ads in ./ad.module
Callback for the Ajax request to get ads.

File

./ad.session.inc, line 7
Code for the ad cookie tracking.

Code

function ad_session_start() {
  if (variable_get('ad_session_enable', FALSE)) {
    $cookie_name = ad_session_get_cookie_name();
    if (!$_COOKIE[$cookie_name]) {
      $value = ad_uniqid('session');
      ad_session_get($value);
      $expire = variable_get('ad_session_expire', REQUEST_TIME + 60 * 60 * 24 * 30 * 12);
      setcookie($cookie_name, $value, $expire);
    }
  }
}