Storing Data To Config File


I am having some problems trying to store data into a config file in Codeigniter

The Problem
The session data grows too big and seems to exceed the 4kb which is the cookie max size. As a result for example flashdata stops working.

Why It Happens
It seems that config variables are added 4 times into the session inside of following objects:

  • CI_Hooks Object (should be turned off)
  • CI_Utf8 Object
  • MY_Router Object (used for replacing ‘_’ with ‘-’ in URL)
  • CI_URI Object

Interestingly the hooks object is present even if the functionality is turned off in the config file: $config[‘enable_hooks’] = FALSE;

01 - how do you store config data without it being multiplied in the session?
02 - also, why does the hooks object seem to be enabled when it has been disabled in the config?

Other Details

  • CI_VERSION 2.1.3
  • Session library is autoloaded
  • Sessions are stored into db
  • Session cookie is encrypted
  • Config files are loaded in the pages where they are used, mainly inside constructors
  • The config data is not huge and would fit very well to 4kb if it wasn’t multiplied

Session data ( print_r($this->session) ) :
[hooks] => CI_Hooks Object ( [enabled] => [hooks] => Array ( ) [in_progress] => ) [config] => CI_Config Object ( [config] => Array…

Thanks in advance for your help, it would be much appreciated…