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

Procedural to OOP
John Kleijn said that to avoid writing "crappy code", we should learn OOP and common OO pr

Need PHP help... have all the elements... just need help putting them together :
Hey Guys,

I was wondering if someone could help me. I am doing a website for a client which

image upload, resize THEN submit form
Ok so I have a form that requires the user to upload an image, and then do something with that image

Preg_match with an array
is there an away to use preg_match with an array?

i want to check a string with an array to s

Extending Exception to contain method name
I was wondering, if there's a way to extend Exception in such a way, that it would contain name of a

chat
hello i'm amir i need a chat source code in asp.net 2.0 without Ajax. anybody can help me?

having a small php error tha deals with the 'foreach'
Last night i was working on a script for a cart and it seemed to working good, until this morning. F

Merger of 6 sister companies under one flagship company after go live
Dear Experts,
I need one help regarding Merger of sister companies of same group. currently we

Need Successful Return
Hello I am currently working a form here, and I have everything figured out except when I click the

php title problem
Hi,

I am having a problem managing my page title with PHP.

Currently I have my <

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