jaymc Posted October 17, 2007 Share Posted October 17, 2007 I am thinking of using session to hold 8 pieces of information For instance, when a user clicks on a whosonline list maybe they like to to be displayed Z-A by default Normally you would save this data in a database.. which I will However, I dont want to have to query the database everytime I need to find out if they want something displayed to there Z-A preference So, upon login I was thinking of querying the database and then storing everything I need in SESSIONS Is this the norm or are there better ways to do this. If it is the norm, can you think of any reason why this would be a bad idea.. Cheers Quote Link to comment https://forums.phpfreaks.com/topic/73633-solved-using-session-to-store-data/ Share on other sites More sharing options...
zq29 Posted October 17, 2007 Share Posted October 17, 2007 It's a perfectly fine idea - Though, this data will only be stored for the length of the session - If you want this data to still be available next time they visit without querying the database, it might be worth looking into cookies. Though the load on the database you will be causing will be next to nothing anyway, with regards to the session method. Quote Link to comment https://forums.phpfreaks.com/topic/73633-solved-using-session-to-store-data/#findComment-371462 Share on other sites More sharing options...
jaymc Posted October 17, 2007 Author Share Posted October 17, 2007 There no is limit on the session, they are saved until they logout and I have a script delete them Would that be a problem in regards to 1000's of open sessions Quote Link to comment https://forums.phpfreaks.com/topic/73633-solved-using-session-to-store-data/#findComment-371476 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.