问题
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