Storing Data To Config File

Discussion in 'PHP' started by oo7ml, Dec 20, 2012.

  1. #1
    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]Questions[/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...
     
    oo7ml, Dec 20, 2012 IP
  2. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #2
    By writing code - manually - to do what you want. (This is the main reason for writing your own code - so it does what you want.)

    And it won't be if you write the code to store the data you want - and nothing else - stored.
     
    Rukbat, Dec 20, 2012 IP