I need to delete a cookie and then do a redirect. However the cookie doesn\'t get deleted until the redirect is processed. The problem is that if the cookie still exi
I discovered if I perform an AJAX call for anything, it qualifies as a refresh for the purposed of deleting cookies.
var fakeAjax = new XMLHttpRequest();
var anything = fakeAjax.responseText;
fakeAjax.open("GET","ajax_info.txt",false); // file doesn't actually exist
fakeAjax.send();
Note the "false" in the Open line. Asynchronous has to be set to false (or some other delay) to allow time for the new info to come back and the cookie to be deleted.
UPDATE: IE doesn't like requesting responseText from a file that doesn't exist so just remove that line completely. Other browsers seem to be fine with or without it.