Amending configuration settings to run sessions in a database

"Why do I need to do this; I'm not using sessions at the moment and besides, I have already covered sessions in another recipe?" I know; I hear you; but the CodeIgniter Cart class makes use of sessions in order to build a cart for the customer or user. We'll go over sessions here with the Cart class in mind. If you've already implemented sessions, you can probably skip this recipe.

Getting ready

Before we launch into the cart example, we need to do a little housekeeping. First, we'll alter some config settings, which will allow CodeIgniter to save Cart information to the database, and then we'll create a simple database schema to handle products, and so on.

How to do it...

There are some ...

Get CodeIgniter 2 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.