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'];



Question: Buying New Electronics During the 9 Days
Answer: http://ohr.edu/1097


  One should not purchase an object of joy that will be available after
  Tisha B’Av for the same price.