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

(This post was last modified: 07-25-2016, 02:01 PM by ivantcholakov. Edit Reason: a correction 2 )

About:

* Get the USER group
* Get his GROUP permissions
* Get the USER ACL permissions
* Get the USER company_ID

This kind of data you can read once from database at the beginning of the request processing, when the user gets authenticated, and then you can just keep it in memory. You can make a model Current_user that within its properties keeps this kind of data and that has getter/setter methods. Thus you can avoid repetitive database queries. No session storage needs to be involved.

$group = $this->current_user->get_group();
$permissions = $this->current_user->get_group_permissions();
Reply


Messages In This Thread
RE: Is Session a safe place to store data ? - by ivantcholakov - 07-25-2016, 01:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB