Commits

Greg Aker  committed 432da06

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>

Fixed a bug (Reactor #229) where the Sessions Library example SQL in the documentation contained incorrect SQL.

  • Participants
  • Parent commits a37b801

Comments (0)

Files changed (3)

File user_guide/changelog.html

 		<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>
 	<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>

File user_guide/installation/upgrade_203.html

 
 <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 -->

File user_guide/libraries/sessions.html

 <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.