ecshop用户登录问题及ecshop购物车问题解决办法

关于ecshop2.7.0在部分IE浏览器下丢$_SESSION的问题、ecshop 用户登陆后自动跳出的问题

经查常是$_SESSION丢失,在网上查找发现IE6也有不少SESSION丢失的问题,这时,就要通过COOKIE来找回登录状态,但是 includes\modules\integrates\ecshop.php这个整合自身会员的类中没有重写integrate.php中的check_cookie()方法导致,验证cookie时返回的username为空,丢失了登录状态,在ecshop.php中重写了此方法后一切正常了:

/**
     * 检查cookie
     *
     * @access  public
     * @param
     *
     * @return void
     */
    function check_cookie ()
    {
        if ( isset($_COOKIE['ECS'])  && isset($_COOKIE['ECS']['user_id'])  && isset($_COOKIE['ECS']['password']))
        {
      $ecs_user_id   = $_COOKIE['ECS']['user_id'];
   $ecs_user_pass = $_COOKIE['ECS']['password'];
            $sql = "SELECT " . $this->field_name ." AS user_name".
                   " FROM " . $this->table($this->user_table) .
                   " WHERE ".$this->field_id." = '$ecs_user_id' AND ".$this->field_pass." = '$ecs_user_pass'";
            $username = $this->db->getOne($sql);
            if ($username && ($this->charset != 'UTF8'))
            {
                $username = ecs_iconv($this->charset, 'UTF8', $username);
            }
            return $username;
        }
        else
        {
            return '';
        }
    }

转载自:http://www.9958.pw/post/ecshop_login_cart

转载于:https://my.oschina.net/u/1179286/blog/638842

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值