Hi the logout button is not working in chrome. It is working fine in Firefox. However if I press F12 and keep the developer console open then the button works. The button also works when I press enter. I'm confused. Here is my code.
HTML Code:
<form name="logoutform" method="post" onsubmit="logoutConfirmation()" action="" >
<input type="submit" value="Logout" id="logoutbutton" name="userlogout" ><br>
</form>
JS Code:
function logoutConfirmation()
{
alert("Thank you. Have a nice day!");
}
PHP Code:
if(isset($_POST['userlogout']))
{
setcookie('user_name', '');
setcookie('user_id', '');
session_destroy();
header("Location: index.php");
}