codeigniter sess_driver and path

后端 未结 1 798
你的背包
你的背包 2021-02-06 12:17

I am trying to upload my codeigniter 3 site to godaddy, but I keep getting errors messages such as Session: Configured save path \'C:\\Windows\\Temp\' is not

1条回答
  •  后悔当初
    2021-02-06 13:05

    On your session save path looks like you are trying to save it to folder

    create the a folder in application called ci_sessions make it 0700

    $config['sess_driver'] = 'files';
    $config['sess_cookie_name'] = 'ci_session';
    $config['sess_expiration'] = 7200;
    $config['sess_save_path'] = APPPATH . 'ci_sessions/';
    $config['sess_match_ip'] = TRUE;
    $config['sess_time_to_update'] = 300;
    $config['sess_regenerate_destroy'] = FALSE;
    

    If you need to put it into database

    $config['sess_driver'] = 'database'; // Change files to database
    $config['sess_cookie_name'] = 'ci_session';
    $config['sess_expiration'] = 7200;
    $config['sess_save_path'] = 'ci_sessions'; // This will be your database table for sessions
    $config['sess_match_ip'] = TRUE;
    $config['sess_time_to_update'] = 300;
    $config['sess_regenerate_destroy'] = FALSE;
    

    For MYSQL Database

    CREATE TABLE IF NOT EXISTS `ci_sessions` (
        `id` varchar(40) NOT NULL,
        `ip_address` varchar(45) NOT NULL,
        `timestamp` int(10) unsigned DEFAULT 0 NOT NULL,
        `data` blob NOT NULL,
        KEY `ci_sessions_timestamp` (`timestamp`)
    );
    

    0 讨论(0)
提交回复
热议问题