I have written a login script that works perfectly fine on my test server (localhost), but it does not work when I upload it to my web host's web server.
I have narrowed it down to a problem with session - after successfull login, the session is set successfully, and the user is redirected, but when the page the user is redirected to loads, the session is apparantly gone.
I would prefer to not post the full source (yet), but here's the logic of it:
login.php: shows form, submits to self, check user/pass and set $_SESSION['loggedIn'] = true; then redirects to index.php
index.php: checks for $_SESSSION['loggedIn'] == true (if not set, or false, redirect back to login.php).
So the problem is that $_SESSION['loggedIn'] doesn't even exist when the user is redirected to index.php after successfully logging in and setting the session in login.php.
Does anyone have any clue on what could cause something like this? The web host server does support cookies/session - i made a very simple test, and it works, so i guess there must be something with my code... :( But I really don't understand it, because there's nothing that would delete a cookie (except for the logout.php script).