Session lost after redirect in Codeigniter

前端 未结 13 2401
清歌不尽
清歌不尽 2021-02-05 06:39

I\'m using codeigniter as a framework.

Firstly, I use localhost but when I change to my IP address the login function doesn\'t work anymore. I found that th

13条回答
  •  别跟我提以往
    2021-02-05 07:05

    It's too late but i was facing same problem luckily i solve this problem by change little bit on configurations as below.

    $config['sess_cookie_name']     = 'ci_session';
    $config['sess_expiration']      = 7200;
    $config['sess_expire_on_close'] = FALSE;
    $config['sess_encrypt_cookie']  = TRUE; // change this
    $config['sess_use_database']    = FALSE;
    $config['sess_table_name']      = 'ci_sessions';
    $config['sess_match_ip']        = TRUE; // change this
    $config['sess_match_useragent'] = TRUE; // change this
    $config['sess_time_to_update']  = 300;
    

    Hope this would work for you too.

提交回复
热议问题