summaryrefslogtreecommitdiffstats
path: root/system/libraries/Session.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-06-14 02:09:53 +0200
committerAndrey Andreev <narf@bofh.bg>2012-06-14 02:09:53 +0200
commitd163e0b219b8afacea3cd0d1d7c2ce5bb6f8a933 (patch)
tree59412b72fb1886fb414bc78c2d4f194c5159d686 /system/libraries/Session.php
parent35d6b35182b6ed65c34ca7bf06975b93f4cd403b (diff)
Polish changes from pull #1233 - Session class already has the time_reference setting - 'GMT' is a valid timezone, so nothing needs to be changed in order to work properly (upgrade notes) - Altered some description text
Diffstat (limited to 'system/libraries/Session.php')
-rw-r--r--system/libraries/Session.php12
1 files changed, 5 insertions, 7 deletions
diff --git a/system/libraries/Session.php b/system/libraries/Session.php
index 9fdf744c3..72a942b8a 100644
--- a/system/libraries/Session.php
+++ b/system/libraries/Session.php
@@ -149,11 +149,11 @@ class CI_Session {
public $flashdata_key = 'flash';
/**
- * Function to use to get the current time
+ * Timezone to use for the current time
*
* @var string
*/
- public $time_reference = 'time';
+ public $time_reference = 'local';
/**
* Probablity level of garbage collection of old sessions
@@ -203,7 +203,7 @@ class CI_Session {
// manually via the $params array above or via the config file
foreach (array('sess_encrypt_cookie', 'sess_use_database', 'sess_table_name', 'sess_expiration', 'sess_expire_on_close', 'sess_match_ip', 'sess_match_useragent', 'sess_cookie_name', 'cookie_path', 'cookie_domain', 'cookie_secure', 'cookie_httponly', 'sess_time_to_update', 'time_reference', 'cookie_prefix', 'encryption_key') as $key)
{
- $this->$key = (isset($params[$key])) ? $params[$key] : $this->CI->config->item($key);
+ $this->$key = isset($params[$key]) ? $params[$key] : $this->CI->config->item($key);
}
if ($this->encryption_key === '')
@@ -786,14 +786,12 @@ class CI_Session {
*/
protected function _get_time()
{
- $timezone = config_item('time_reference');
-
- if ($timezone === 'local' OR $timezone === date_default_timezone_get())
+ if ($this->time_reference === 'local' OR $this->time_reference === date_default_timezone_get())
{
return time();
}
- $datetime = new DateTime('now', new DateTimeZone($timezone));
+ $datetime = new DateTime('now', new DateTimeZone($this->time_reference));
sscanf($datetime->format('j-n-Y G:i:s'), '%d-%d-%d %d:%d:%d', $day, $month, $year, $hour, $minute, $second);
return mktime($hour, $minute, $second, $month, $day, $year);