Message: ini_set(): A session is active. You cannot change the session module's ini settings at this time

前端 未结 7 1430
误落风尘
误落风尘 2020-12-20 14:00

I created a login page with codeigniter,but i get the php message.

Message: ini_set(): A session is active. You cannot change the session module\'s ini setting

相关标签:
7条回答
  • 2020-12-20 14:34

    This works for me:

    if (!isset($_SESSION)) {
       // server should keep session data for AT LEAST 24 hour
       ini_set('session.gc_maxlifetime', 60 * 60 * 24);
    
       session_start();
    
       // each client should remember their session id for EXACTLY 24 hour
       session_set_cookie_params(60 * 60 * 24);
    }
    
    0 讨论(0)
提交回复
热议问题