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.

Did you know?Explore Trending and Topic pages for more stories like this.
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

Calling strings from other php class
I have test1.php{
$string1;
$string2;
....
... //10 strings in this class <

PHP5/Zend 2.0 - Resources
PHP5 Snapshots
http://snaps.php.net/

ZEND 2.0 Feature Overview and Design (PDF File

strtotime issue
Hey all,

I'm playing around with some code, and basically the idea is:

Person changes

ereg_replace()
Basically what i need to do is

$title = "This Suck's"

$striped = ereg_repl

Basic Question about Threading and PHP...
I have a page that I am working on and it is taking several hours to process. The basics of what th

PHP Surveys
I really would like some advice.

If you have a client come to you asking for a survey to be d

ImageCreate()
When I create an image and add text to it I want my text to be replaced with a PNG image, because th

Blocking video streaming
Hello everyone,

I post a message here because i didn't find any solution yet.
I just finis

Login script (probably a simple error)
dbConfig.php
Code: <?
// Replace the variable values below
// with your specific dat

Referential Integrity problem when inserting into 2 tables at same time
Hello Everyone,

Im relativity new to PHP and MySQL and i have come up against a problem. 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