Codeigniter + Chrome错误(ERR_RESPONSE_HEADERS_TOO_BIG)。如何解决? [英] Codeigniter + Chrome error (ERR_RESPONSE_HEADERS_TOO_BIG). How to solve?

查看:185
本文介绍了Codeigniter + Chrome错误(ERR_RESPONSE_HEADERS_TOO_BIG)。如何解决?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Chrome浏览器打开时,使用CodeIgniter 1.7开发的网络应用程序出现错误 ERR_RESPONSE_HEADERS_TOO_BIG 。我尝试与所有其他浏览器的错误不会发生。

My web application develop using CodeIgniter 1.7 is having error ERR_RESPONSE_HEADERS_TOO_BIG when open with Chrome browser only. I tried with all other browser the error will not happen.

我可以在刷新错误页面后正常打开页面。我尝试从Google搜索,似乎这个错误发生在Chrome用户从2009年到现在。

I can open the page normally after i refresh the error page. I try search from Google, it seems this bug happen to Chrome user since 2009 until now.

这是我的控制器代码:

function search_daily_sales_summary_view()
{
    if(!($this->session->userdata('DAILY_SALES_SUMMARY'))){
        $this->session->set_flashdata('error', 'You dont have the permission to access that page.');
        redirect('login/home');
    }

    $this->load->model('currency_model');
    $this->load->model('bill_model');

    $data = array();

    $report = array();

    if($query = $this->currency_model->list_currency())
    {
        foreach ($query as $row) {

        $currencyid = $row->CURRENCY_ID;
        $currencycode = $row->CURRENCY_CODE;

        if($buyData = $this->bill_model->calculate_buy($currencyid))
        {
            $totalbuy = $buyData->total_from_amount;
            $totalbuy_rate = $buyData->rate;

            if($buyData->total_from_amount=='')
            {
                $totalbuy = 0.00;
            }

            if($buyData->rate=='')
            {
                $totalbuy_rate = 0.00;
            }
        }
        else
        {
            $totalbuy = 0.00;
            $totalbuy_rate = 0.00;
        }

        if($sellData = $this->bill_model->calculate_sell($currencyid))
        {
            $totalsell = $sellData->total_from_amount;
            $totalsell_rate = $sellData->rate;

            if($sellData->total_from_amount=='')
            {
                $totalsell = 0.00;
            }

            if($sellData->rate=='')
            {
                $totalsell_rate = 0.00;
            }

        }
        else
        {
            $totalsell = 0.00;
            $totalsell_rate = 0.00;
        }

        $report[] = array("currency"=>$currencycode, "buy"=>$totalbuy, "buyrate"=>$totalbuy_rate, "sell"=>$totalsell, "sellrate"=>$totalsell_rate);

        }

        $data['records'] = $report;

    }

    $this->load->model('company_model');
    if($query = $this->company_model->list_company())
    {
        $data['company_list'] = $query;
    }

    $this->load->model('branch_model');
    if($this->input->post('company'))
    {
        $companyid = $this->input->post('company');

        if($query = $this->branch_model->view_company_branch($companyid))
        {
            $data['branch_list'] = $query;
        }
    }
    else
    {
        if($query = $this->branch_model->list_branch())
        {
            $data['branch_list'] = $query;
        }
    }

    $this->load->view('report/daily_sales_summary', $data);

}

如何解决这个问题?

推荐答案

CI将会话存储在Cookie中。

CI stores sessions in a cookie. If you store too much in a cookie, you get errors.

将CodeIgniter改为使用数据库会话,或将其保存到文件中。

Set CodeIgniter to use DB sessions instead, or save this to a file.

这篇关于Codeigniter + Chrome错误(ERR_RESPONSE_HEADERS_TOO_BIG)。如何解决?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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