You know already from our Iteration 2 Presentation that we planned to improve the logout process of our MapYourBuddies application (You mentioned this also in your Iteration 2 Reviews)
After Thomas was not very successful - see "Logout procedure and its problems" - with his work on the "Logout Challenge", I started working yesterday evening on a "workaround" for this issue.
What I tried was the following:
- Click on "Logout" link opens the "Welcome" page in the same (main) window and an onclick function opens a popup window
- A timer is set to close the window after 2 seconds
- Within the popup window the logout.html submits the "facebook POST request with the necessary parameters" immediately
- The http://www.facebook.com/logout.php is loaded in this popup window
- The popup window SHOULD be closed and the focus should go back to the welcome page (in the main window)
Here is the "Logout" link Code: (the index.html is our welcome page)
<a href="../index.html" onclick="popUp(
'../php/logout.html')">Logout</a>
The popUp() function looks like this:
function popUp(URL)
{
logoutvar = window.open(URL, "tobeclosed", "toolbar=0");
window.setTimeout("doit()", 2000);
window.focus();
}
The logout.html contains basically this
<!doctype html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html><head><title>Bye</title></head>
<body>
<form action="http://www.facebook.com/logout.php"
method="POST" name="logio">
<input type=hidden name=confirm value="1">
</form>
<script type="text/javascript"
language="JavaScript">document.logio.submit()</script>
</body>
</html>
And the doit() function should just close this window (after this 2 seconds)
function doit()
{
window.logoutvar.close();
}
The issue with this solution is, that the doit() function doesn't work and the "logoutvar" window (that poped up) never closes.
Is that maybe because the content/domain of this window changed (from logout.html to http://www.facebook.com/logout.php) ?
Does anybody has an idea why the window doesn't close?
Finally I saw this morning, that Jeffery responded (Thanks for that, Jeff!!!) to Tom's blog post and proposed another solution. Unfortunately the example that Jeffery posted doesn't work in my browsers (WIN XP; IE 7.0 & FF 2.0.0.3). But either Thomas or I will investigate and further explore this idea in the next couple of days.
Proposals are always welcome ;)
-Joern