CodeIgniter IE无法正确存储会话 [英] CodeIgniter IE not storing sessions correctly

查看:123
本文介绍了CodeIgniter IE无法正确存储会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Cart类的CodeIgniter,基本上只是会话。现在,Safari正在处理它们完美,正在做它应该做的。另一方面,IE不会存储它们。

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.

所以经过一段时间试图修复这个,我想把会话添加到数据库。
Safari向数据库中添加一个结果,并填写所有字段。现在IE。

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


推荐答案

I通过在阅读20页后在Google上找到一个网站固定它。
修改后更改

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

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

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

这篇关于CodeIgniter IE无法正确存储会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆