我的CodeIgniter会话数据库表中有多个重复项。我该如何解决这个问题?
我尝试了以下内容:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Session extends CI_Session
{
/**
* Update an existing session
*
* @access public
* @return void
*/
function sess_update()
{
// skip the session update if this is an AJAX call!
if ( !IS_AJAX )
{
parent::sess_update();
}
}
}
/* End of file MY_Session.php */
/* Location: ./application/libraries/MY_Session.php */
和这个config.php
$config['sess_cookie_name'] = 'session';
$config['sess_expiration'] = 0;
$config['sess_expire_on_close'] = FALSE;
$config['sess_encrypt_cookie'] = TRUE;
$config['sess_use_database'] = TRUE;
$config['sess_table_name'] = 'sessions';
$config['sess_match_ip'] = TRUE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update'] = 600;
我在自动加载器中加载MY_Session
库,但我不知道是否需要更改其他内容。