【发布时间】:2012-02-12 12:28:13
【问题描述】:
好吧,这很奇怪。我刚刚将 CodeIgniter 代码移到了我客户的虚拟主机 serverlogic.com。这段代码已经在 40 多台其他服务器上运行,但现在我突然陷入困境。我正在使用数据库会话。
这不起作用:
$this->session->set_flashdata('contact_message', validation_errors());
$this->session->set_flashdata('first_name', $this->input->post('first_name'));
$this->session->set_flashdata('last_name', $this->input->post('last_name'));
$this->session->set_flashdata('email', $this->input->post('email'));
$this->session->set_flashdata('zip', $this->input->post('zip'));
$this->session->set_flashdata('phone', $this->input->post('phone'));
$this->session->set_flashdata('comments', $this->input->post('comments'));
这行得通:
$this->session->set_flashdata('contact_message', validation_errors());
$this->session->set_flashdata('first_name', $this->input->post('first_name'));
$this->session->set_flashdata('last_name', $this->input->post('last_name'));
$this->session->set_flashdata('email', $this->input->post('email'));
/*$this->session->set_flashdata('zip', $this->input->post('zip'));
$this->session->set_flashdata('phone', $this->input->post('phone'));
$this->session->set_flashdata('comments', $this->input->post('comments'));*/
由于 set_flashdata() 方法使用 cookie 来跟踪数据,一旦 cookie 中存储的数据过多,是否会达到某些服务器限制?在调查我的服务器上的标头时,与此服务器相比,它设置了更多的 cookie。
我还从他们的服务器获取了一个 PHPSESSID cookie,但我不知道它来自哪里。我不是服务器管理员,因为他们使用的是 Nginx,所以我对这个完全一无所知。
【问题讨论】:
-
cookies 只能存储这么多信息,所以你可能会达到极限
-
如果是 cookie 限制,难道不是所有设置都会发生这种情况吗?
标签: php codeigniter session cookies