I am building a small application that users can log into using CodeIgniter
My question is, when a user logs in, is it advisable to store a lot of the users personal information in the session (like their user id, name, email and telephone number). Or should I try leave personal information out and just keep their user id in the session only?
I don't want to have to make database queries constantly to get some or the users basic information.
Update
I will be using a database to store all their information, I just want to know when they log in, is it advisable to keep their data stored in a session as well as the database?
Thanks
You should only keep temporary data in sessions that tracks that current user. Anything else should stay hidden in the database until it's needed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With