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

admin with my register system?
Hey i wana make it so i can make a admin level on my register system , I'm kinda new to php to im no

Multiple server callbacks (NOT POSTBACKS)
Hello, I have 2 different javascript client side functions that are on timers. When the timers elap

Accessing Infotype data in dialog program
Hi All
In Dialog programs attributes I didn't see any logical database field. How can I access

What am I missing here? Help!
Hello all!. I can't seem to get this working right. Well - it renders right, but something is goin

can i optmize image to 50% quality before uploading 2 server
Hi there

i have jus written a php program to upload and display images but when i try to uplo

Using unserialize()
Hi there.

I have some data in my database that is serialized.

e.g.

a:2:{i:0

Storing Values taken from a DB...
Using this code it will generate a short list from my database

<?php
mysql_connect

Time-based image rotation script
I'm trying to write a PHP script that rotates an image based on what time of day it is. I want the

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

turning an array into a string then poping it into a db
Hi im just wondering how you get a requested array into a single string then pop it into the db so f

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