I am using a pre controller hook to detect and set the site language from the session/cookie/browser lang detection.. something like this answer: Codeigniter language
I am also using the famous Tank Auth library to manage users and I am using the codeigniter Session class to store and manage the users sessions upon log in. Each user can specify the interface language he wants and store it in the database for future log ins. The lang info is copied from the DB to the session on every log in.
The problem is: I can't check the user session from inside the hook. How would I know (in case of logged in users) if his session has the lang info or not?
I am not sure if the hook approach is the best one in case of handling logged in users sessions. Let me know please if I can have a better approach.
Thanks in advance