oo7
oo7

Reputation: 203

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:

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

Questions

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

Other Details

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...

Upvotes: 3

Views: 303

Answers (1)

Rooneyl
Rooneyl

Reputation: 7902

If you are having problems with CI sessions (which are just really cookies) I would suggest using a different session library.

This one uses native PHP sessions, so you don't get the problems with the 4kb limit, or if you really want to keep with CI sessions then use the database function to store the values.

Upvotes: 1

Related Questions