html - Incorrectly redirecting user back to a PHP page after submitting a form -
all, this question has simple answer - i'm overlooking. maybe can tell me look... i have php page ("index.php") simple login form (e.g., username , password). when user clicks "submit" button, form posts values php page ("login.php"). page supposed confirm user's credentials, following: if user's credentials not correct, redirect user error.php, along error message if user's credentials correct, create session , set $_session['authenticated'] = true, redirect him "loggedin.php" [update] then, on loggedin.php, check see isset($_session['authenticated']) returns true. if does, proceed. if not, redirect user index.php. however, here's happens. first time fill out form (with valid creds) , submit it, can see briefly in url bar user sent login.php, loggedin.php, back index.php. but, if re-enter same credentials , submit info second time, works should. so, in short, looks either login.php...