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

Securing a user input - need some confirmation
Hello All,

I am in the process of recoding a large proportion of an e-commerce site, one of t

Getting a variable to work in function params
I have this fuction which is inside a class:

Code: public static function generateEmbedCode($

Variable Clash
In the past I've had variables clash. For example:

Code: <?php
$c = 5;
$ca

Format String help
I have a textbox where a person enters an application number. the application number is 10 characte

max function question
Hi All
Ihave a table that holds shipment numbers and dates like this

select * from

Quick variable question
hey guys/gals,
im trying to write a php script and it works fine as i have it, but i need to set

Async WSAConnect failed on XP with error code = 2 ("File not found")
Hi all,

I have very strange bug, please help me if you can.

It is reproduced o

how to remove in php string display
My code is $message="We're looking at developing our website."; $body= "My mess

Good Programming and Web Design Books
Hi,

I recived a pm today from a fellow phpfreaker regarding php books, i replied with the fo

Text to picture Generator
Hello, i have found this script and it works really good^^ But i have one problem, i would like to c

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