21 January 2021

How to create (Use) SESSION in Codeigniter?

 Create (Use) SESSION in Codeigniter

Use in Controller

         $this->load->library('session');

$id=5;

        $this->session->set_userdata('ID',$id);

        redirect('dashboard', 'refresh');



        if ($this->session->userdata('ID') == TRUE)

        {

            //do something

redirect('dashboard');

}

else{

//echo 'hello<br>';

}

No comments:

Post a Comment

How to create video slider with cuncks of videos without download all videos?

 Create video slider with cuncks of videos without download all videos function custom_video_slider_shortcode() { $slider_id = 'vide...