summaryrefslogtreecommitdiffstats
path: root/system/libraries/Session
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-06-02 10:16:32 +0200
committerAndrey Andreev <narf@devilix.net>2014-06-02 10:16:32 +0200
commitac4f47283a6a8ce575f59c15c1a08ad3bc2efdd9 (patch)
tree28b6b31fdc256a7b6b45f1fbc85da7efcb6b722d /system/libraries/Session
parente1b9665567bbfc28bb13e5e41093901a8da99a0d (diff)
#3073: BC workarounds for sess_use_database, sess_expire_on_close
Diffstat (limited to 'system/libraries/Session')
-rw-r--r--system/libraries/Session/Session.php5
-rw-r--r--system/libraries/Session/Session_driver.php6
2 files changed, 11 insertions, 0 deletions
diff --git a/system/libraries/Session/Session.php b/system/libraries/Session/Session.php
index 518dc28b0..bdcde1e76 100644
--- a/system/libraries/Session/Session.php
+++ b/system/libraries/Session/Session.php
@@ -70,6 +70,11 @@ class CI_Session {
{
$this->_driver = $driver;
}
+ // Note: BC workaround
+ elseif (config_item('sess_use_database'))
+ {
+ $this->_driver = 'database';
+ }
if (($class = $this->_ci_load_classes($this->_driver)) === FALSE)
{
diff --git a/system/libraries/Session/Session_driver.php b/system/libraries/Session/Session_driver.php
index c46ca3a34..cc35b66d1 100644
--- a/system/libraries/Session/Session_driver.php
+++ b/system/libraries/Session/Session_driver.php
@@ -133,6 +133,12 @@ abstract class CI_Session_driver implements SessionHandlerInterface {
if ($this->_expiration)
{
ini_set('session.gc_maxlifetime', $this->_expiration);
+ ini_set('session.cookie_lifetime', $this->_expiration);
+ }
+ // BC workaround for setting cookie lifetime
+ elseif (config_item('sess_expire_on_close'))
+ {
+ ini_set('session.cookie_lifetime', 0);
}
// Security is king