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?
Asked
Active
Viewed 287 times
0
-
Do they have cookies enabled? – Explosion Pills May 16 '12 at 22:22
-
1Is the laptop's system time correct? – Gerd Riesselmann May 17 '12 at 21:11
-
Can you provide more samples? – Ben May 17 '12 at 22:57
-
Colin, not a duplicate. I originally asked that vague question and had no idea what was going on. Now i narrowed it down and forgot to just edit that one. – Dylan Buth May 17 '12 at 23:16
-
@DylanButh - Can you include the code you're using to set the session variable? – Ben May 18 '12 at 12:11
2 Answers
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
-
-
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
-
-
My apoligies, that is what i have. I was just using the "=" to explain it in the question. I will edit that now. – Dylan Buth May 17 '12 at 22:54
-
It's not possible for `$session->userdata('admin_logged_in') = true` to set any session variables. – Ben May 17 '12 at 22:55
-
-
I didnt copy and paste. My mistake on that. It has no problem redirecting. – Dylan Buth May 18 '12 at 13:13