Computer isn't saving session [duplicate]

↘锁芯ラ 提交于 2019-12-11 18:09:18

问题


The session on a computer is not being saved across pages. It is on my computer, but not on a different one. The computer has cookies enabled. Is there anything that might cause a computer not to save sessions?


回答1:


Make sure he has cookies enabled.

This explains why you need cookies enabled for sessions to work:

The client usually stores and sends the token as an HTTP cookie {...} The reason to use session tokens is that the client only has to handle the identifier—all session data is stored on the server

http://en.wikipedia.org/wiki/Session_(computer_science)#HTTP_session_token




回答2:


if (!$this->session->userdata('admin_logged_in') {
      redirect('/auth/');
 }

This code is missing a ) which means it wouldn't parse in PHP. Did you copy and paste from your code?



来源:https://stackoverflow.com/questions/10627575/computer-isnt-saving-session

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!