1

I have a website with a login system. It works fine for me. When I log in the session->userdata('admin_logged_in') gets set to true.. My co-worker is trying to log in to the site but the session isnt set. It gets set initially but when he changes pages, the sessions are cleared.

We tried adding our own sessions to the site, they got cleared when the page changed. we tried different sites and the sessions didnt save there either.

So my question is, does anyone know why his computer, an asus laptop, wouldnt allow sessions to be saved.


COOKIES ARE ENABLED :)

This is the code for how it works.

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

In the manager function,

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

It redirects for my co worker to "auth" every time. It works fine for me.

We tried

 var_dump($this->session->userdata('admin_logged_in'))

and for me is said bool(true) and for him it said bool(false).

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

1 Answers1

0

Instead of echo "admin ..." you should do a debug:

var_dump($this->session->userdata('admin_logged_in'));

to find out whats in the variable/object. so you can re-engineer to the cause of the problem.

Sliq
  • 15,937
  • 27
  • 110
  • 143
  • I tried that and mine said true. his said false. Why would they be different for us? I tried it on my two friends' computers and both of theirs worked. What could be specific about his? – Dylan Buth May 16 '12 at 20:59
  • you "tried on my two friends computers" ??? what ? sorry, but are you sure you know what you are doing ? sorry to say that, but this looks extremely unprofessional. please don't be offended, but i'm very sure you just started php/coding, so the problem might have a very simple solution. are you sure you are STILL logged in as admin ? – Sliq May 16 '12 at 21:41
  • I tried logging in on my two friends computer and both of them worked. That's why i'm asking what could cause my friends computer to clear the session userdata. – Dylan Buth May 16 '12 at 21:56