Welcome Guest, Not a member yet? Register   Sign In
Session Trouble

Hello, everyone-

I'm having a strange problems with sessions.

I have been stuggling with this for a while and this is the simplest way I can explain it:

if ($user !== $this->session->userdata('active_customer')) {
   $this->session->set_userdata('active_customer', $user);
echo $this->session->userdata('active_customer');
Echoes the user id just like expected.

In any other controller:
echo $this->session->userdata('active_customer');
Echoes 'css'

I have no idea where css comes from or why it is replacing the session data. If I open the session table in phpMyAdmin, it shows 'css' from the start.

Anyone have any ideas?

Thanks in advance.

When it's working and displays the user id in the first controller, have you confirmed the correct value exists in the session table (you mentioned confirming the incorrect value exists when it's not working)?

If so, one thing you could try is tracing it from the database side, i.e., check your log file (enabling first if necessary) for the relevant SQL statements to get an idea of what's being generated, and when.

Also, how about putting some debugging output statements into the CI session code?

Someone may have a direct solution for your specific problem, but until that comes along maybe this will help. Wink

Theme © iAndrew 2016 - Forum software by © MyBB