![]() |
Using sessions in loader.php? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Using sessions in loader.php? (/showthread.php?tid=11377) |
Using sessions in loader.php? - El Forum - 09-06-2008 [eluser]P.T.[/eluser] Hello all, First of all, thanks for the wonderfull framework! I am still learning the framework, but it works really nice ![]() Now, i got a question. I created my own way to handle language files. I save the language in a session called 'language'. Now i want that session to be loaded in the loader.php file where the standard language files are autoloaded. Since languages files are loaded before libraries, I cut the language loading part and placed it right below the libraries loading part. Code: // Load all other libraries 'english' should be replaced here with the language session. I tried something like this: $language = MY_Session::userdata('language'); But I retrieve an empty / false variable. But if I am correct, the sessions are already loaded and ready for use. Any idea what I am doing wrong or any idea how I could fix this? Or am i doing something stupid? (By the way, i know that their is a standard language thingy around. Which adds something to your URL, but that's not what we want.) Using sessions in loader.php? - El Forum - 09-06-2008 [eluser]Jamie Rumbelow[/eluser] Try putting the code to check for the session and load the language file in a controller, then inherit every other controller from that one. This also works for things like authorisavion. Using sessions in loader.php? - El Forum - 09-08-2008 [eluser]P.T.[/eluser] Sometimes, things look so difficult but are yet so easy. Thanks! |