Consolidated session->set_userdata calls to fix 502 errors when behind an Nginx proxy

这个提交包含在:
Andy Smith 2015-03-18 08:12:12 +00:00
父节点 2d19c07d5e
当前提交 c20dfafef1

查看文件

@ -43,12 +43,20 @@ class QSO extends CI_Controller {
$this->logbook_model->add(); $this->logbook_model->add();
// Store Basic QSO Info for reuse // Store Basic QSO Info for reuse
$this->session->set_userdata('band', $this->input->post('band')); // Put data in an array first, then call set_userdata once.
$this->session->set_userdata('freq', $this->input->post('freq')); // This solves the problem of CI dumping out the session
$this->session->set_userdata('mode', $this->input->post('mode')); // cookie each time set_userdata is called.
$this->session->set_userdata('sat_name', $this->input->post('sat_name')); // For more info, see http://bizhole.com/codeigniter-nginx-error-502-bad-gateway/
$this->session->set_userdata('sat_mode', $this->input->post('sat_mode')); $qso_data = [
$this->session->set_userdata('radio', $this->input->post('radio')); 'band' => $this->input->post('band'),
'freq' => $this->input->post('freq'),
'mode' => $this->input->post('mode'),
'sat_name' => $this->input->post('sat_name'),
'sat_mode' => $this->input->post('sat_mode'),
'radio' => $this->input->post('radio')
];
$this->session->set_userdata($qso_data);
// Get last Ten QSOs // Get last Ten QSOs
$data['query'] = $this->logbook_model->last_ten(); $data['query'] = $this->logbook_model->last_ten();
@ -103,12 +111,16 @@ class QSO extends CI_Controller {
$this->logbook_model->create_qso(); $this->logbook_model->create_qso();
// Store Basic QSO Info for reuse // Store Basic QSO Info for reuse
$this->session->set_userdata('band', $this->input->post('band')); $qso_data = [
$this->session->set_userdata('freq', $this->input->post('freq')); 'band' => $this->input->post('band'),
$this->session->set_userdata('mode', $this->input->post('mode')); 'freq' => $this->input->post('freq'),
$this->session->set_userdata('sat_name', $this->input->post('sat_name')); 'mode' => $this->input->post('mode'),
$this->session->set_userdata('sat_mode', $this->input->post('sat_mode')); 'sat_name' => $this->input->post('sat_name'),
$this->session->set_userdata('radio', $this->input->post('radio')); 'sat_mode' => $this->input->post('sat_mode'),
'radio' => $this->input->post('radio')
];
$this->session->set_userdata($qso_data);
// Get last Ten QSOs // Get last Ten QSOs
$data['query'] = $this->logbook_model->last_ten(); $data['query'] = $this->logbook_model->last_ten();