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

user administration
Dear @all,

what I have to do to set the user defaults for new users. At the moment I woul

xml
<?php

echo "<h1>XML Articles</h1>";

$home

PEAR Email Attachment w/ $gpg
I have no issues with this code if I take out the attachement section and include the info in the em

Preventing SQL Injection
I have a question about SQL Injection, In some of our code we use this: view plaincopy to clipboa

ob_ dynamic content
i was wondering about the potential to use ob to create a <div then remove it when the page

INSERT data problem!
After having an string with apostrophes ', double quotes " or any other special characters, suc

Array to string conversion
Can anyone help me with this?

Notice: Array to string conversion in /home/..../index.php on l

Preg_match question
I want to use preg_match to make sure a string is always 6 characters long and only contains 0-9 and

News script
Hi ...

I am not sure if this is the rite place to post this but if its not sorry

i am

Including calander to page - will not show other months than current??
im trying to add an existaing calander onto a profile page by using Code: <?php include "

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