Welcome Guest, Not a member yet? Register   Sign In
user info and app info in sessions
#1

[eluser]ruiganga[/eluser]
Hi

I'm starting with sessions. I wish to separate USER info from APP info. Lets say:

userinfo
- email
- logged (true or false)
- nickname

appinfo
- language

This way when user logs out I still keep the app info to show the correct language to the user.

Since sessions are loaded automatically, I was thinking about the best place to put my code to create USERINFO and APPINFO information since they are needed all over the app.

Is I land at a site.com/post/id/1 I wish the app to generate the info in the sessions to the rest of the app works without errors.

So, where to put my code?

Thanks.
#2

[eluser]Unknown[/eluser]
use the __construct()-method of your controller.

but language is something not often change by user, you better use a regular cookie for this or try to detect the language.




Theme © iAndrew 2016 - Forum software by © MyBB