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

value not going in data base
hello friends....
i am having a working javascript....when i am selecting any

get the country of visitor and display content based on that
Hello all,

I have seen that Google analytics can tell you where a visitor is coming from and

Forms Authentication and Refresh at Login page
Hello, When I try to press the Login button in my webapplication at my login.aspx page nothing h

isset undefined variable
Hi all,

Hope someone can point out the obvious. I've a log in script, if you dont enter a use

User feedback after MySQL query has been executed
Hi all, I've just registered on PHPFreaks because I've got a question that I simply can't work out b

Limiting uploaded file type
I am working on a simple upload script, and I need it to limit the allowed file type that is uploade

Line break?
Hi, I'm new to the forum and new to php. I'm not sure if I'm using the correct terminology so here i

Take info from one coloum and move to another
Hi all,

I have this:
Code: [Select]$array = "SELECT stock_id FROM stocks WHERE stock_

Firefox displaying PHP source code??
Currently testing a site thats almost built, am going to be including php on a sidebar on all pages

Trouble with a select list
Hello All!
I was wondering if any of you guys could help me with a small problem I'm having!

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