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

. and .. appearing instead of pictures
First of all, thanks very much for providing this forum. It is very much appreciated!

My son

small inaccuracies
I have this code to convert fractional base 10 into base 2:

while($num > 0)

login page does not execute a else statement
I've created a login page using sessions.
When an incorrect user name or password is entered then

Help on code output
My CODE:

Code: [Select] echo "<phone>".$line["phone"].&qu

Get value from Select menu
Hi!

Have tried to find the solution on the web. Don't know if there is an easy one. A descrip

Displaying Site Logo/Icon on a Title tag
really need some help out here. I want to insert a Logo/Icon just like the one close to the "PH

login from external site
Hi my new experience begins, Now what i am trying to do is i make three pages, login.php logout.php

Members Only
Hi all, for my website i have a members area only which on members can veiw, but at the moment anyon

simple script won't work. Please help
I'm new to php, and I am having trouble displaying a simple script in my web browser. My php code ex

array help
Does anyone know how to require 10 text fields for individual grades and output class average? (10 p

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