I'm trying to remove a cookie in a GWT application that I have. I first tried using Cookies.removeCookie
, but it didn't seem to have any effect. I'm fairly certain this is because removeCookie doesn't let you specify the domain and path.
I'm trying now by setting the cookie to expire at the epoch time, but when I check in chrome's dev tools, the cookie's expiry time is set to "Session", it's not removed immediately as I expected.
Here's what I'm using. I'm using the same parameters I used when I set the cookie, the only difference is the value and the date.
boolean secureCookie = "https:".equalsIgnoreCase(Window.Location.getProtocol());
Cookies.setCookie("cookieName", "", new Date(0), null, "/", secureCookie);