Jump to content

[SOLVED] Using Session To Store Data


jaymc

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.