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

asp.net - Procedure or function "Procedure name" expects a parameter "Param name" which was not supplied occurs rarely -

jsp - No mapping found for HTTP request with URI with annotation config Spring MVC and Jetty -

sql server ce - Is there some way to make sqlce3.5 and 4.0 co-exist in the C# project -