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

Sort a two dimensional array.
Hi. I've set up a two dimensional array that reads as follows:

Code: $modifiedData = array(

pageination not working right... coping images over 4 pages
Code: <?php //This code will obtain the required page number from the $_GET array. Note that

Calculating a rating by adding number of points and dividing by number of items
I have a site that users can post links to files to download. They can rate these files on a 1-5 sca

script is pulling more then they have....
I have this script for my game where they can change there race. This will cost them 2,500 points. H

Set Categories
I am creating a submission form for somebody to come in and submit products. These products are sep

Security Exception on pages using AJAX
I am getting the exception: attempted to perform an operation not allowed by the security policy on

Appending GET data with form submition
Okay, what I'm trying to do is to use a form to append an already existing GET data string.

I

Help with search.php
Hello All

I need the search engine on a site I am building at the moment to display the searc

php libs/ browsercap.in
ok i have a host that refuses to stay current. they control my php settings and libs. is there a way

Multi-image upload problems
Lets see if I can get some help on this one. Can anyone show me what I am doing wrong here. I'm just

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