I have a PHP authentication system on my website using the $_SESSION variable.
A form submits a username and password to the file \"login.php\". It is handled like t
Try to replace
if($_POST){...}
with
if( isset($_POST['username']) && isset($_POST['password']) ){...}
... at least for debugging purposes. It's possible that some different settings are causing a non-empty $_POST array where it's not expected.
Also, your code seems to be missing exit()
calls after header()
redirections. Sending an HTTP Location header doesn't automatically stop your script.