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 youtube videos slider with play and pause option in wordpress?

Create youtube videos slider with play and pause option in wordpress youtube videos slider Use this shortcode:- [punjab_today] function my_...