dpacmittal Posted December 17, 2009 Share Posted December 17, 2009 I am making a user class for my script which stores all the user information in sessions. It takes user id as parameter and gets the info from database and stores it in the session variable. I did this for easy access of data as I don't want to query database every now and then. Is this a good practice? If not, why? Quote Link to comment https://forums.phpfreaks.com/topic/185458-is-it-a-good-practice-to-store-user-info-in-sessions/ Share on other sites More sharing options...
Adam Posted December 17, 2009 Share Posted December 17, 2009 It takes user id as parameter and gets the info from database I'm guessing you meant user ID and password? But yeah, this is pretty common practice. Quote Link to comment https://forums.phpfreaks.com/topic/185458-is-it-a-good-practice-to-store-user-info-in-sessions/#findComment-979120 Share on other sites More sharing options...
mrMarcus Posted December 17, 2009 Share Posted December 17, 2009 make sure to treat sensitive information accordingly appropriately whilst storing in formation in session vars or cookies for that matter. Quote Link to comment https://forums.phpfreaks.com/topic/185458-is-it-a-good-practice-to-store-user-info-in-sessions/#findComment-979132 Share on other sites More sharing options...
dpacmittal Posted December 17, 2009 Author Share Posted December 17, 2009 Thanks guys. Quote Link to comment https://forums.phpfreaks.com/topic/185458-is-it-a-good-practice-to-store-user-info-in-sessions/#findComment-979136 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.