0
我使用cookie我的登錄系統和系統適用於Chrome,但後來當我去到IE或Safari瀏覽器,它不工作。由於某些原因,cookies沒有設置,我試圖迴應他們無濟於事。Cookie在Chrome中運行,但不在IE或Safari中運行?
這裏是使餅乾代碼:
if(isset($_POST['log_in_iniator'])){
$username = $_POST['username'];
$password = $_POST['password'];
$log_in_checker_status = check_user_data($username, $password);
if($log_in_checker_status == 'true'){
//user has successfully logged in, create two cookies
//cookie 1 username
setcookie('username', $username, 0, 'http://shkeek.com');
setcookie('loginstatus', 'true', 0, 'http://shkeek.com');
header("Location: index.php");
}else{
setcookie('loginstatus', 'invalid', 0);
header("Location: index.php");
}
}