我已經在CI中構建了一個站點,並且有一個登錄系統,在Firefox中可以正常工作,但不是Chrome或IE。在這兩個,如果用戶名和密碼是正確的,它只是重定向(我想)回到登錄頁面,而不是登錄錯誤頁面,或網站家(應該)。我注意到它似乎沒有在Chrome中設置cookie,但它在FF中。CodeIgniter Cookie在FF中工作,但不是Chrome或IE
下面是我的控制器,設置cookie和驗證後重定向代碼:
$newdata = array(
'username' => $_POST['login_username'],
'real_name' => $name,
'user_id' => $uid,
'logged_in' => TRUE
);
$this->session->set_userdata($newdata);
//echo $newdata;
redirect('/site/index');
任何想法,爲什麼這可能發生?
謝謝
也許這可以幫助:http://stackoverflow.com/questions/917475/creating-a-cookie-failing-with-safari-chrome-ie-but-working-with-ff – trix 2010-11-24 20:56:36
另一種解決方案可能是這個帖子。 http://stackoverflow.com/a/29114118/1226309 – mariofertc 2015-03-18 04:30:43