I am calling the javascript window.open() function to load another url in a pop up. Once the users is finished it takes them to the last page that has a link that says close
I know this post is old, but I found that this really works well:
window.onunload = function() { window.opener.location.href = window.opener.location.href; };
The window.onunload part was the hint I found googling this page. Thanks, @jerjer!
window.onunload