You are here

function uc_store_exit in Ubercart 6.2

Same name and namespace in other branches
  1. 5 uc_store/uc_store.module \uc_store_exit()

Implements hook_exit().

File

uc_store/uc_store.module, line 586
Contains global Ubercart functions and store administration functionality.

Code

function uc_store_exit() {

  // Don't save anything to the session if this is the first request of a session
  if (empty($_COOKIE[session_name()])) {
    return;
  }

  // Save the current request for tracking paths on subsequent page requests.
  // When HTTP_REFERER is set, the session version is not; and vice versa.
  if (referer_uri() == '') {
    $protocol = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http';
    $q = isset($_GET['q']) ? $_GET['q'] : '';
    $_SESSION['uc_referer_uri'] = $protocol . '://' . $_SERVER['SERVER_NAME'] . $GLOBALS['base_path'] . $q;
  }
  else {
    if (isset($_SESSION['uc_referer_uri'])) {
      unset($_SESSION['uc_referer_uri']);
    }
  }

  // Save the timestamp of the last access.
  // $_SESSION['uc_last_access'] = time();
}