summaryrefslogtreecommitdiffstats
path: root/user_guide
diff options
context:
space:
mode:
Diffstat (limited to 'user_guide')
-rw-r--r--user_guide/changelog.html4
-rw-r--r--user_guide/installation/upgrade_203.html10
-rw-r--r--user_guide/libraries/sessions.html18
3 files changed, 23 insertions, 9 deletions
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index bbdbbbd19..70db33d48 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -78,7 +78,7 @@ Change Log
<ul>
<li>Added an optional third parameter to <samp>heading()</samp> which allows adding html attributes to the rendered heading tag.</li>
</ul>
- </li>
+ </li>
</ul>
<h3>Bug fixes for 2.0.3</h3>
@@ -86,6 +86,8 @@ Change Log
<li class="reactor">Added ENVIRONMENT to reserved constants. (Reactor #196)</li>
<li class="reactor">Changed server check to ensure SCRIPT_NAME is defined. (Reactor #57)</li>
<li class="reactor">Removed <samp>APPPATH.'third_party'</samp> from the packages autoloader to negate needless file stats if no packages exist or if the developer does not load any other packages by default.</li>
+ <li>Fixed a bug (Reactor #231) where Sessions Library database table example SQL did not contain an index on last_activity. See <a href="installation/upgrade_203.html">Upgrade Notes</a>.</li>
+ <li>Fixed a bug (Reactor #229) where the Sessions Library example SQL in the documentation contained incorrect SQL.</li>
</ul>
<h2>Version 2.0.2</h2>
diff --git a/user_guide/installation/upgrade_203.html b/user_guide/installation/upgrade_203.html
index 38cfb72c9..d7c0fae3a 100644
--- a/user_guide/installation/upgrade_203.html
+++ b/user_guide/installation/upgrade_203.html
@@ -94,6 +94,16 @@ Upgrading from 2.0.2 to 2.0.3
<p>Which should provide for nominal performance gains if not autoloading packages.</p>
+<h2>Update Sessions Database Tables</h2>
+
+<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>
+ CREATE INDEX last_activity_idx ON ci_sessions(last_activity);
+</code>
+
+
+
</div>
<!-- END CONTENT -->
diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html
index 8d9c14eb6..6048f4809 100644
--- a/user_guide/libraries/sessions.html
+++ b/user_guide/libraries/sessions.html
@@ -218,15 +218,17 @@ be updated, they can only be generated when a new session is created.</p>
<p>In order to store sessions, you must first create a database table for this purpose. Here is the basic
prototype (for MySQL) required by the session class:</p>
-<textarea class="textarea" style="width:100%" cols="50" rows="8">
+<textarea class="textarea" style="width:100%" cols="50" rows="10">
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,
-last_activity int(10) unsigned DEFAULT 0 NOT NULL,
-user_data text DEFAULT '' NOT NULL,
-PRIMARY KEY (session_id)
-);</textarea>
+ session_id varchar(40) DEFAULT '0' NOT NULL,
+ ip_address varchar(16) DEFAULT '0' NOT NULL,
+ user_agent varchar(50) NOT NULL,
+ last_activity int(10) unsigned DEFAULT 0 NOT NULL,
+ user_data text NOT NULL,
+ PRIMARY KEY (session_id),
+ KEY `last_activity_idx` (`last_activity`)
+);
+</textarea>
<p><strong>Note:</strong> By default the table is called <dfn>ci_sessions</dfn>, but you can name it anything you want
as long as you update the <kbd>application/config/config.php</kbd> file so that it contains the name you have chosen.