Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.4k views
in Technique[技术] by (71.8m points)

php - Codeigniter + Chrome error (ERR_RESPONSE_HEADERS_TOO_BIG). How to solve?

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.

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.

This is my controller code:

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

}

How to solve this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...