I am trying to delete a cookie on page refresh but I am unable to achieve it. I have done this so far
//delete the cookie on page refresh
window.onunload = unloadPage;
function unloadPage()
{
$.removeCookie('count', { path: '/' });
}
This code is at the top of my js
file.
I have also tried answers here at stackoverflow
UPDATE I am using laravel and I am using this code to set the cookie
$response->withCookie(cookie()->forever('count', $count));