I finally found my balance in getting auto login using cookie but I encountered a problem. Whenever I test the login with auto login checked. I close the browser and reopen it to test if it works. The weird thing is that I don't appear to be logged in but I actually am when I refresh.
if (isset($_SESSION['user_id'])) {
// Menu with links appear when logged in
}else{
// The login form
}
How do sites set it when users visit the page, the menu of a successful login appear?
if(isset($_SESSION['user_id'])){header('Location: ./');}– ionFish Jul 15 '12 at 17:40