Check that $_SESSION["uid"] is defined before checking value