‘C:\Windows\Temp’ is not writable by the PHP process, Codeigniter session not work in Windows server.
When you haven’t access to change the permission of ‘C:\Windows\Temp’ then store session in a database instead of the path.
Go to Application/config/config.php and change session configuration as per below
1 2 3 4 5 6 7 8 9 10 11 |
$config['sess_driver'] = 'database'; // files to database $config['sess_cookie_name'] = 'ci_session'; $config['sess_expiration'] = 7200; $config['sess_save_path'] = 'ci_sessions'; // database table for sessions $config['sess_match_ip'] = TRUE; $config['sess_time_to_update'] = 300; $config['sess_regenerate_destroy'] = FALSE; |
ci_sessions table structure
1 2 3 4 5 6 7 8 9 10 11 |
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`) ); |
More Stories
How to set EC2 Ubuntu default password
CPU & Memory usage in PHP
Install PHP mcrypt extension on Ubuntu