Welcome Guest, Not a member yet? Register   Sign In
Sessions, database and cache
#1

[eluser]Unknown[/eluser]
Hi all,

I'm writing a little e-shop for a customer, while I'm testing I noticed a strange issue and I would know if it's a bug:

I have database's cache turned on with:
Code:
$db['default']['cache_on'] = TRUE;
in "config/database.php" file.

I have session stored in database with:
Code:
$config['sess_use_database'] = TRUE;
in "config/config.php" file.

With this configuration I was not able to use Cart library because in my session data only the last product was stored. I temporarily fixed it with this small patch:
Code:
--- Session.php.orig    2011-08-03 15:33:27.000000000 +0200
+++ Session.php    2011-08-03 15:33:23.000000000 +0200
@@ -85,6 +85,7 @@
         if ($this->sess_use_database === TRUE AND $this->sess_table_name != '')
         {
             $this->CI->load->database();
+            $this->CI->db->cache_off();
         }

         // Set the "now" time.  Can either be GMT or server time, based on the
applied to "system/libraries/Session.php". It simply disables the cache when the database is used for storing the session data.

Should I report this as a BUG or am I wrong? Smile

thanks in advance

k.
#2

[eluser]Unknown[/eluser]
I'm using this patch for about a week, I'm testing my e-shop application and it seems working fine but I don't know if this solution is correct or there's another way to avoid that problem.

Nobody can help me?

k.




Theme © iAndrew 2016 - Forum software by © MyBB