Sessions in Codeigniter with PHP7 -
the problem simple. if use
$this->session->sess_destroy(); $this->session->sess_regenerate(true);
i error:
message: session_regenerate_id(): cannot regenerate session id - session not active filename: session/session.php line number: 625
that happens php 7 , works 5.6. figured parameter in regenerate function set destroy old session data when regenerating. when leave out sess_destroy() don't error, session data not destroyed , can't log user out.
use ob_start()
before session library. , before session destroying code add ob_flush()
, after line set ob_clean()
and set $this->session->sess_regenerate(true);
false
. ob_flush
, ob_clean
perfectly.
Comments
Post a Comment