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
Post a Comment