When a user visits my website there is a \"Login\" link on every page. Clicking this uses some JavaScript to show an overlay window where the user is prompted for their cred
You can take advantage of the HTML prompt to unload mechanism, by specifying no unload handler:
window.onbeforeunload = null;
window.location.replace(URL);
See the notes section of the WindowEventHandlers.onbeforeunload
for more information.
You could try to create an empty form, method=get, and submitting it.
<form id='reloader' method='get' action="enter url here"> </form>
<script>
// to reload the page, try
document.getElementById('reloader').submit();
</script>