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

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -