0) { if ($_POST["uname"] == "abc" && $_POST["pass"] == "123" && $_POST["action"] == "login"){ // Set cookie setcookie("logintime", time(), time() + 600, $path = "/", $domain = "jeffersonscher.com", $secure = true, $httponly = true); // Set redirect header("Location: https://www.jeffersonscher.com/res/post302form.php"); } elseif ($_POST["action"] == "logout"){ // Expire the cookie setcookie("logintime", "byebye", time() - 3600, $path = "/", $domain = "jeffersonscher.com", $secure = true, $httponly = true); // Set redirect header("Location: https://www.jeffersonscher.com/res/post302form.php"); } else { echo "

The login is abc and 123. Try again please.

"; } } else { echo "

The login is abc and 123. Try again please.

"; } ?>