Check Session is Set or Not in Codeigniter ?

As per CodeIgniter Documentation If Session in not set it return FALSE .


if ($this->session->userdata('variable') !== FALSE) { 
         echo 'Variable is set';
 } else { 
        echo 'Variable is not set'; 
}

No comments:

Post a Comment