简体   繁体   中英

Codeigniter Upgrade 2.2.2 to 3.0 moving sessions to filesystem

I've been following the upgrade guide documented here and have reached the section concerning the new session storage mechanisms.

In the past, my application has stored sessions in the database, but I've opted to move this to the file system as recommended in the documentation.

After initially following the upgrade documentation, I was having problems so I restarted with a fresh copy of the config.php file (the stock version supplied with 3.0) and have changed the following variables (You can assume that anything else in the config not shown below remains as its default value):

$config['base_url'] = 'http://www.domain.com/';
$config['encryption_key'] = 'mykey';

/* default settings omitted */

$config['sess_driver'] = 'files'; 
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = 'application/session_storage';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;

I've created a directory located at /application/session_storage/ to hold the sessions and changed its file permissions to 700 but something still doesn't appear to be correct as I am getting a database error indicating that the database table isn't in the right format.

Am I correct in thinking that by opting to use the file system for session storage, the database is not required at all? and if this is the case, can anyone tell me why CI still trying to input data into it?

It appears that when I followed Step 2 of the upgrade guide which states "Replace all files and directories in your system folder" it was not sufficient to simply drag and drop the directory into FileZilla on top of the existing folder.

On comparing the system files, I now appear to have a combination of files from 2.2.2 and 3.0 and this seems to be causing conflicts. In particular, the file located at system/libraries/Session.php

I've deleted the folder and re-uploaded it and this has solved all problems.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM