CodeIgniter IE not storing sessions correctly

谁都会走 提交于 2019-11-30 09:05:22

问题


I am using the Cart class of CodeIgniter, basically that's just sessions. Now, Safari is handling them perfectly fine and is doing what it is supposed to do. IE, on the other hand, does not store them.

So after a while of trying to fix this, I figured to add the sessions to the database. Safari adds one result to the database with all fields filled out. Now IE. It adds around 5 items to the database with the row 'user_data' being empty.

This is the method adding the item to the cart;

    /**
* 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;
    }
}

回答1:


I fixed it by finding a website on Google after reading through 20 pages. Fixed after changing

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

to

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


来源:https://stackoverflow.com/questions/8850960/codeigniter-ie-not-storing-sessions-correctly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!