destroy session codeigniter 3

$this->session->sess_destroy(); Explanation: - $this: Refers to the current instance of the class. - session: Refers to the session library in CodeIgniter. - sess_destroy(): Function used to destroy all data in the session.