I use session managment with PHP4.03pl1, and have following problem:
On each page that requires login, I inserted function require_login(). That function checks
if (! is_logged_in()) {
$SESSION["wantsurl"] = this_goes_url_of_current_page; redirect("$CFG->wwwroot/login.php");
}
function is_logged_in(){
global $SESSION, $REMOTE_ADDR;
return isset($SESSION)
&& isset($SESSION["user"])
&& isset($SESSION["ip"])
&& $SESSION["ip"] == $REMOTE_ADDR;
}
on page login.php, when I verify user data, I set the $SESSION["user"] and $SESSION["ip"] variables.
So, the problem is. Without proxy, it runs smoothly, but when I turn proxy settings in browser, I can't start the session.
What seems to be the problem.. $REMOTE_ADDR is not changing when going trough proxy.
Thanks