Is it a good practice to store user info. in sessions?


Posted on 16th Feb 2014 07:03 pm by admin

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.

Did you know?Explore Trending and Topic pages for more stories like this.
Is this a good practice? If not, why?
No comments posted yet

Your Answer:

Login to answer
94 Like 43 Dislike
Previous forums Next forums
Other forums

Echo multiple lines of html code
Hi guys,

I would like to know if there is a way to echo multiple lines of html codes.

trouble printing an array....
I'm having some trouble printing out an array forwards. I'm figuring out the high and low of an arra

PHP Session Issue
I'm having an issue with one section on my website dealing with sessions. Now I know that myself and

Echo-ing MySQL content and Keep Formatting?
I have data in my MySQL such as:

QuoteBlah blah

Blah blah

etc
but when i ech

How can i use [] tags instead of <> tags for profiles??
On my site im making ive made it so u can register, login and u have a profile which u can update..<

Multi Level Array Problem
hi all,

For example I have array like below:

$temp = array(array('north america', 'us'

Place specific image in html page when specific name is typed.
Hello,

Fairly new to PHP and was curious if someone might know how to solve a fairly simple r

Time-based image rotation script
I'm trying to write a PHP script that rotates an image based on what time of day it is. I want the

Require select-option functionality in Module Pool Programming
Hi Gurus,

I am doing a development by Module Pool on Warehouse Management. For that devel

Pop-up Banner
Hello Friends,I need to use banner in our client site.Example: www.example.com if i enter this site

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash