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

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -