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

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

css - Can I use the :after pseudo-element on an input field? -