I have created a PHP and Cookie-based Login and Logout system for the admin page of a WebApp I am working on. Issue is when I refresh the page more than 2 or 3 times when I am Logged In, the Log Out function doesn't work properly, and keeps me "Logged In" if I attempt to load an admin page after I have "Logged Out". I am not certain if this is a browser setting, or something I am coding incorrectly.
Login PHP Code:
setcookie("password","$thepassword");
Logout PHP Code:
unset($_COOKIE['password']);
setcookie('password', null, -1, '/');
Any ideas welcome. :) Thanks~