Deleting a cookie in Javascript not working
- by DisgruntledGoat
I have a site where authentication is done externally (which I can't access), so I'm creating a cookie on login in order to display a welcome message to the user. Creating the cookie works fine, I write to document.cookie when the login form submits.
But deleting the cookie doesn't work. Here's my code (logout.php does the external authentication stuff):
<a href="http://external.com/logout.php" style="float:right"
onclick="document.cookie='BRLOG=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.example.com;'">Logout</a>