php - Create unset cookie button -


i have created cookie using php , need create button user can click log out.

this php code unset cookie:

 unset($_cookie['access_token']);   

but i'm quite stuck how make button functionality. can me it?

thanks lot

if(isset($_get['logout'])) {

unset($_cookie['access_token']);

header('location: /');

exit;

}

on site

<a href="?logout">logout</a>


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -