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

python - Why doesn't list have safe "get" method like dictionary? -

razor - Is this a bug in WebMatrix PageData? -

sql server - Stored procedure -