PHP_SELF replaced with SCRIPT_NAME
Minor improvement to redirection after login