codeigniter - How to logout code igniter session without form -
I have a login and logout view but I do not want a form for logout. How do I use a button to log out my session?
You can use a link because without the form, otherwise you will have to use AJAX < / P>
& lt; A href = "& lt ;? php echo base_url ()? & Gt; control_classname_name / logout" & gt; Logout & lt; / A & gt; Function logout () {$ this- & gt; Session-> Sess_destroy (); Redirect ('controller_class / login'); }
Comments
Post a Comment