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

(This post was last modified: 07-24-2016, 01:59 AM by ivantcholakov.)

It is safe, but the approach is not good. Better keep only the user_id and retrieve the additional information by asking it from the models.

What you do now is introducing session dependency within your models. This limits the context where these models can be used. Imagine that in the future you would need to do something under CLI with these models - it would be impossible without heavy rework.

Edit: Remove all the $this->session->something from all the models and pass them as method parameters.
Reply


Messages In This Thread
RE: Is Session a safe place to store data ? - by ivantcholakov - 07-24-2016, 01:57 AM



Theme © iAndrew 2016 - Forum software by © MyBB