0

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?

Dylan Buth
  • 1,648
  • 5
  • 35
  • 57

2 Answers2

0

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

OdinX
  • 4,135
  • 1
  • 24
  • 33
  • Try it in a different web browser. Use Chrome/Firefox/IE (well.. maybe not IE :P ) and see if you get the problem in all three, or just some of the browsers. – OdinX May 17 '12 at 07:41
  • Have a look in the event log and see if anything looks out of place... Use Chrome, take a look in the developer tools -> resources, look under Cookies and Session Storage and see if anything is in either of them. – OdinX May 17 '12 at 21:43
  • Nothing is in either of them. Even when i login successfully from my computer. Both of ours are blank. – Dylan Buth May 17 '12 at 22:01
  • Have you tried it on a third computer? Maybe its being cached for you? – OdinX May 17 '12 at 22:06
  • Yes i have. I tried it on two computers that have never connected before. – Dylan Buth May 17 '12 at 22:13
  • @DylanButh were you able to find a solution to this? I have the same exact problem. – Zahid Sattar Jul 12 '12 at 09:28
  • No i wasnt. Sorry man. Just ended up using a different computer. I'd be very interested if you happen to find one though. – Dylan Buth Jul 14 '12 at 20:55
0
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?

Ben
  • 60,438
  • 111
  • 314
  • 488