Welcome Guest, Not a member yet? Register   Sign In
Is Session a safe place to store data ?
#6

(This post was last modified: 07-25-2016, 10:24 AM by PaulD.)

If they are all linked by user_id with a 1:1 relationship, just do a single query joining all the tables, and get all the data in one go. Storing all that stuff in the session can be done, it is just not a good idea as your end user can easily manipulate the data in the cookie, changing their permissions, their company or their group.

With a well structured database, and well written queries, this additional query will not adversely affect performance. I doubt you will even notice it.

Best wishes,

Paul.

PS Cartalot and ivantcholakov are right, you should not store the user ID directly, nor refer to the session in the models.
Reply


Messages In This Thread
RE: Is Session a safe place to store data ? - by PaulD - 07-25-2016, 10:23 AM



Theme © iAndrew 2016 - Forum software by © MyBB