CodeIgniter Forums
Community Auth - Printable Version

+- CodeIgniter Forums (
+-- Forum: External Resources (
+--- Forum: Addins (
+--- Thread: Community Auth (/showthread.php?tid=74917)

Community Auth - nyl2k8 - 11-25-2019

Hi All,

I'm using Community Auth within my CI project. When a user is on the website there's a session generated in the ci_sessions table. When they log in, a new session is generated preventing me from recovering their cart contents as it's stored against their previous session id. Is it normal behaviour to have a new session id after login? Should it not be persistent like the PHP session data?

Any help here would be greatly appreciated.

Thank you,

RE: Community Auth - InsiteFX - 11-28-2019

I would not depend on the session for cart data, you would be better off saving the
session cart data to a database table for cart_contents.

Then when they login you can just read the cart_contents for that users id and update
your session to reflect the cart contents.

RE: Community Auth - skunkbad - 11-28-2019

It’s considered best practice to rotate the session Id when logging in. So it’s not that you have a new session, it’s that it has a new Id.

RE: Community Auth - ehabafia - 11-29-2019

You shuold store the card data with the and not the

this way, once the user logged in again, you can grab the data from the cart table where = x.

I hope that helps.