Session not working on CodeIgniter

邮差的信 提交于 2019-12-11 17:25:23

问题


Hi guys my session is not working on CodeIgniter, please help.. Following is my config

$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = 'ci_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;

I am setting like as follows

$this->session->set_userdata('test', "Hello world!");

And trying to retrieve as follows and it prints empty

$this->session->userdata('test')

Printing all the session

var_dump($this->session->all_userdata());

prints

array(1) {
  ["session_id"]=>
  string(32) "968esdf9539d0bdc29faeb48ad86948"}

I have gone through https://forum.codeigniter.com/post-325982.html


回答1:


This is an issue with CodeIgniter itself Replace the system folder with the latest version of codeIgniter and it started working, replace with version 3.1.0 . I was using 3.0



来源:https://stackoverflow.com/questions/48973842/session-not-working-on-codeigniter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!