I’ve just started using CodeIgniter 2. I resisted a framework for so long but have finally realised that my mish mash collection of classes, functions, config files is a nightmare to keep updated across multiple projects.
I was looking at CI’s session class and noticed the following:
A useful aspect of the session array is that you can add your own data to it and it will be stored in the user’s cookie. Why would you want to do this?
Arrrgghh! That sounds so wrong to me for so many reasons. Here’s my question…
Is it possible to use PHP’s native session functions and access $_SESSION when using CodeIgniter?
Or is there something in CI that will prevent me from doing so? Any security features that deny direct access to super globals or something?
I found this but it looks like it’s designed for CI 1.5 and I’m not sure how updated it would be. I think I would prefer to use my own wrappers for PHP’s native sessions – if I can actually use PHP’s native sessions.
I should also add that I’d prefer not to store sessions in a DB either, in case of connectivity/latency issues.
Inside
config.phpthere is a option which is default to use cookies:Description
So it looks like you could change this to use native PHP sessions.