2012-01-13 83 views
2

我使用Cart類的CodeIgniter,基本上這只是會話。現在,Safari正在處理它們,並且正在做它應該做的事情。另一方面,IE不存儲它們。CodeIgniter IE沒有正確存儲會話

因此,經過一段時間的努力解決這個問題,我想把會話添加到數據庫。 Safari將一個結果添加到數據庫中,並填寫所有字段。現在IE。它將大約5個項目添加到數據庫,其中'user_data'行爲空。

這是將物品添加到購物車的方法;

/** 
* Method to add an item to the shopping cart. 
* 
* @access public 
* @param integer $product_id 
* @param string $name 
* @param string $name_clean 
* @param string $image 
* @param integer $price 
* @return boolean 
* @since v0.1.0.0 
*/ 
public function insert_item_cart($product_id='1',$name='default',$name_clean='default',$image='default',$price=1.00) 
{ 
    // Prepare the data to be added to the cart. 
    $data = array(
     'id'   => $product_id, 
     'qty'   => 1, 
     'name'   => $name, 
     'price'   => $price, 
     'options'  => array('name_clean' => $name_clean,'image' => $image) 
    ); 

    // Insert the item to the cart. 
    if ($this->cart->insert($data)) 
    { 
     return true; 
    } 
    else 
    { 
     return false; 
    } 
} 
+0

做的域名包含奇怪的字符,如 「_」 後修正?我在IE中也遇到了Sessions的問題,並且不能在像這樣的域中解決它... – Abadon 2012-01-13 13:03:01

+0

name包含空格,name_clean包含像「 - 」這樣的字符,圖像包含一個點。 – Roel 2012-01-13 13:03:58

+0

不,我的意思是域..例如:www.foo_bar.net – Abadon 2012-01-13 13:05:27

回答

7

我在閱讀了20頁後通過在Google上找到一個網站來修復它。 改變

$config['sess_cookie_name']  = 'ci_session'; 

$config['sess_cookie_name']  = 'cisession'; 
+0

非常感謝!快速和正確的答案老兄。 – 2015-05-22 16:28:28