Welcome Guest, Not a member yet? Register   Sign In
Storing Data To A Config File
#1

[eluser]Unknown[/eluser]
Hi,

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;

[B[COLOR="#FF0000"]]Questions[/COLOR][/B]
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...
#2

[eluser]Aken[/eluser]
I don't get what you're trying to do here. You say you're trying to store data into a config file, but then you talk about sessions and the database.

Show us some code or something, because I'm lost.




Theme © iAndrew 2016 - Forum software by © MyBB