diff options
author | Greg Aker <greg.aker@ellislab.com> | 2011-04-20 18:36:45 +0200 |
---|---|---|
committer | Greg Aker <greg.aker@ellislab.com> | 2011-04-20 18:36:45 +0200 |
commit | 50671cf8d67c805692fec49eda33d21227a21ec2 (patch) | |
tree | e09abb9be02ae56e7c983ad86d1531b8b1ec308d | |
parent | 882b76bda8b701a8718960b8d639f060ae79e998 (diff) |
Altered Session to use a longer match against the user_agent string. See upgrade notes if using database sessions.</li
-rw-r--r-- | system/libraries/Session.php | 4 | ||||
-rw-r--r-- | user_guide/changelog.html | 5 | ||||
-rw-r--r-- | user_guide/installation/upgrade_203.html | 3 | ||||
-rw-r--r-- | user_guide/libraries/sessions.html | 2 |
4 files changed, 10 insertions, 4 deletions
diff --git a/system/libraries/Session.php b/system/libraries/Session.php index 32317c2e6..2c8a80163 100644 --- a/system/libraries/Session.php +++ b/system/libraries/Session.php @@ -189,7 +189,7 @@ class CI_Session { } // Does the User Agent Match? - if ($this->sess_match_useragent == TRUE AND trim($session['user_agent']) != trim(substr($this->CI->input->user_agent(), 0, 50))) + if ($this->sess_match_useragent == TRUE AND trim($session['user_agent']) != trim(substr($this->CI->input->user_agent(), 0, 120))) { $this->sess_destroy(); return FALSE; @@ -316,7 +316,7 @@ class CI_Session { $this->userdata = array( 'session_id' => md5(uniqid($sessid, TRUE)), 'ip_address' => $this->CI->input->ip_address(), - 'user_agent' => substr($this->CI->input->user_agent(), 0, 50), + 'user_agent' => substr($this->CI->input->user_agent(), 0, 120), 'last_activity' => $this->now ); diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 70db33d48..7ff71d07a 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -79,6 +79,11 @@ Change Log <li>Added an optional third parameter to <samp>heading()</samp> which allows adding html attributes to the rendered heading tag.</li> </ul> </li> + <li>Libraries + <ul> + <li>Altered Session to use a longer match against the user_agent string. See upgrade notes if using database sessions.</li> + </ul> + </li> </ul> <h3>Bug fixes for 2.0.3</h3> diff --git a/user_guide/installation/upgrade_203.html b/user_guide/installation/upgrade_203.html index d7c0fae3a..7dbc907ea 100644 --- a/user_guide/installation/upgrade_203.html +++ b/user_guide/installation/upgrade_203.html @@ -98,8 +98,9 @@ Upgrading from 2.0.2 to 2.0.3 <p>If you are using database sessions with the CI Session Library, please update your <samp>ci_sessions</samp> database table as follows:</p> -<code> +<code> CREATE INDEX last_activity_idx ON ci_sessions(last_activity); + ALTER TABLE ci_sessions MODIFY user_agent VARCHAR(120); </code> diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 6048f4809..a6f3c601c 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -222,7 +222,7 @@ prototype (for MySQL) required by the session class:</p> CREATE TABLE IF NOT EXISTS `ci_sessions` ( session_id varchar(40) DEFAULT '0' NOT NULL, ip_address varchar(16) DEFAULT '0' NOT NULL, - user_agent varchar(50) NOT NULL, + user_agent varchar(120) NOT NULL, last_activity int(10) unsigned DEFAULT 0 NOT NULL, user_data text NOT NULL, PRIMARY KEY (session_id), |