codeigniter session across all controllers

what would be the best way to allow sessions to be used across all my controllers? i think there are a couple ways to do it:

1) define() session into global variables. I heard this is not best approach
2) set up a general MY_controller and extend every other controller to it. set up sessions there and that will make them available in all classes
3) something that has to do with adding &get_instance() to the __contructor() function that comes on the top of every controller
what would be the best way of setting sessions across all controllers?

i wasnt able to use any of these methods. any ideas would be helpfull. Thanks

BTW, the problem was that codeigniter doesnt like simultaneous ajax requests. They interfere with each other and session data gets erased.

Leave a Reply

*

Hire Me
Follow Me!
Search
Most Popular Articles & Pages
Because your vote is Important
Sorry, there are no polls available at the moment.
Categories