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

Add code to enable passing of checkbox variable on login
Ok, I have a login page, but want to add a checkbox that when checked and successful login is made i

How to update this array?
I am saving a string that looks this: username1, username2, username3...
into a single cell in a

OPINIONS WANTED
This is my login page code, and I want your opinion on it please!

Code: // Login ~ CHECKS

Table Control
Hi Guru's,

I've created a Module pool program, which contains the Table Control.

please fix the error
What is the error in the below code ???
Line number On/Off | Expand/Contract <?php

Undefined variable when using $_SERVER['PHP_SELF']
Hi guyz, please suggest me something...
On first.php I have one input field NAME, and on posting

Confusing Functions
So, I've been reading up on Functions and I like them! However, I need some help using variables in

Remote Database Access
Hey guys!!

OK, i'm used to only working with databases from the CPANEL, accessing phpMyAdmin

Renaming a file that a user uploads to site?
My site allows for registered users to upload images to the site under their own gallery. Currently

Help with setcookie()
Merry Xmas to those on this foruum
Older guy here with some experience but not allot so please be

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