diff options
author | Andrey Andreev <narf@devilix.net> | 2015-03-21 11:41:38 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2015-03-21 11:41:38 +0100 |
commit | 737a5660c09e844d44969d1b7e8165b5f0296e37 (patch) | |
tree | c1cc0c70471fa5f69633eae55f501b23e7d730de | |
parent | b011716ecce4ac8f28aad08fa4ed824102ff2cd2 (diff) |
[ci skip] Forbid DB session usage with cache_on enabled
-rw-r--r-- | system/libraries/Session/drivers/Session_database_driver.php | 4 | ||||
-rw-r--r-- | user_guide_src/source/libraries/sessions.rst | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/system/libraries/Session/drivers/Session_database_driver.php b/system/libraries/Session/drivers/Session_database_driver.php index 76c1cf34e..1d01c2923 100644 --- a/system/libraries/Session/drivers/Session_database_driver.php +++ b/system/libraries/Session/drivers/Session_database_driver.php @@ -93,6 +93,10 @@ class CI_Session_database_driver extends CI_Session_driver implements SessionHan { throw new Exception('Configured database connection is persistent. Aborting.'); } + elseif ($this->_db->cache_on) + { + throw new Exception('Configured database connection has cache enabled. Aborting.'); + } $db_driver = $this->_db->dbdriver.(empty($this->_db->subdriver) ? '' : '_'.$this->_db->subdriver); if (strpos($db_driver, 'mysql') !== FALSE) diff --git a/user_guide_src/source/libraries/sessions.rst b/user_guide_src/source/libraries/sessions.rst index 2317f8560..54655ff79 100644 --- a/user_guide_src/source/libraries/sessions.rst +++ b/user_guide_src/source/libraries/sessions.rst @@ -569,9 +569,10 @@ However, there are some conditions that must be met: - Only your **default** database connection (or the one that you access as ``$this->db`` from your controllers) can be used. - - You can NOT use a persistent connection. - You must have the :doc:`Query Builder </database/query_builder>` enabled. + - You can NOT use a persistent connection. + - You can NOT use a connection with the *cache_on* setting enabled. In order to use the 'database' session driver, you must also create this table that we already mentioned and then set it as your |