views:

43

answers:

1

I am using the cart class for a shoping cart.

Now I want to use the Simplelogin library, but the cart session is erased when I login.

How can this be solved ?

It is possible to use two sessions for one user ?

Or maybe merge all in the same session ?

+1  A: 

I don't know if this will help you, since I don't use Code Igniter and don't know how the stuff is handled there.

But I usually use sub-arrays for everything I do in sessions, so no vars are in danger of being overwritten. So if I have a login-script it would only save to $_SESSION['login'] (for example $_SESSION['login']['password_hash'])

If that's not possible with code igniter or that library always deletes the session (what kind of library would do something like that???) you have to save the data somewhere else. Either in a hidden form field in the login-form (don't forget to serialize the data first) or in a Cookie.

b_i_d
Thanks, I just realized that when I Login the session was deleted, and a new session was created. I just commented that two lines.
Code Burn