Welcome Guest, Not a member yet? Register   Sign In
storing persistent config data as session, or?..
#1

[eluser]ntheorist[/eluser]
Hi, i'm working on a CMS app, and when a user logs in and the system starts up i need it to initialize an array of tables, fields, metadata, config data, etc, from the DB that would provide a map for the system to reference (on every subsequent page reload).

In a previous version (Before CI), i used the $_SESSION array, which worked like a charm. Unfortunately it doesn't seem available in CI, and while i could store the array using session->set_userdata, the size limit of 4k could be easily exceeded with the amount of data i might need to store.

The data is read from the DB, so i could have a hook throw it into a $config item dynamically, but i'd like to know if there's another way to store persistent data that wouldn't require the site to run a query each page reload to set it up. I'd like to have the data read only either from a restored user session or through the login process.

My only idea at the moment is to have a single page (unaccessible through the admin) that would literally 'write' a cms_config.php file, and then have the system reference that, but that seems a bit over-complicated.

any idears?

thx,

_CC_




Theme © iAndrew 2016 - Forum software by © MyBB