user info and app info in sessions


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

- email
- logged (true or false)
- nickname

- 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 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?


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.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.