I tried storing the REQUEST_URI in a session with the code below. I need to store the very first REQUEST_URI when a visitor lands on a page on our site and not have it overwritten when they begin browsing pages. This isn't working as I browse the site i'm seeing a new URI displayed by the echo.
session_start();
if ( !isset( $_SESSION['theuri'] ) ) {
if ( !empty( $_SERVER['REQUEST_URI'] ) ) {
$_SESSION['theuri'] = $_SERVER['REQUEST_URI'];
}
}
echo $_SESSION['theuri'];