OK, to use access the original Request URI via a cookie, I modified referer.php by adding the following code at the end. It worked for my 4.0.13 edition. Hope it helps someone.
Code:
# set a cookie that remembers the original request Added by Michael on 11-28-07
$request = $HTTP_SERVER_VARS["REQUEST_URI"];
x_session_register("request_session");
if (!isset($HTTP_COOKIE_VARS["RequestCookie"]) || empty($request_session)) {
if(empty($request_session)) {
$referer_session = (isset($HTTP_COOKIE_VARS["RequestCookie"])?$HTTP_COOKIE_VARS["RequestCookie"]:$request);
}
$request = $request_session;
$_tmp = parse_url($current_location);
setcookie("RequestCookie", $referer, time()+20*60, "/", $_tmp["host"]);
}
-Michael