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.

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

PHP using IF to display error
i have a MySQL query and i want to display 1 thing only if the number of affected rows is >=1

help retrieiving results and doing pagination
Having some trouble trying to get the results to show on more than just one page.

What is ha

Mail Script Problems
I have created a PHP mail script. I am having a problem though. In $body i am trying to put two va

storing results of a function - previous result overwritten with new result
I have created a function to validate input.

function validate_dimension($value,$name) {
<

Database connection failure
Hello All,

I am trying to create new connection to Oracle DB 10.1,
I could not see a

try catch error
I have been trying try catch but, I can't get it to work. The code opens a non existing file called

Problem with PHP code- simple contact form
Hi Folks,
I'm relativily new to PHP; I know HTML and CSS stuff but I have a problem- I have a co

Help on Order Entry Form/System Where is best to begin.
I have a dilema and a very short amount of time at this point and I'm looking for some help on decid

Renaming a file that a user uploads to site?
My site allows for registered users to upload images to the site under their own gallery. Currently

SQL Query/echo not working
Hey all,

I'm trying to run (what I thought) was a simple operation and it isn't working. I h

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