php - how can is delete all session information? -
i'm getting ready upgrade website, , in new update, there need new session variable user_level. i'm wondering if there anyway server side can end sessions without having code anything. if not, intention test whether or not variable set, , if isn't destroy session forcing user relog. this..
if(!$this->session->userdata['user_level']) { $this->session->sess_destroy(); }
userdata
function
not array
read session docs
try this,
if(!$this->session->userdata('user_level')) { $this->session->userdata = array(); $this->session->sess_destroy(); }
if want unset single session variable
use like,
$this->session->unset_userdata('user_level');// remove user_level session
Comments
Post a Comment