First, thank all of you, who tried to help us finding a solution for our "Big Facebook Logout Challenge". Here I may mention especially Chidambaram's Posts 1, 2, 3 and also Jeff's in general good idea.
Second, maybe some words how we came to this "Big Facebook Logout Challenge". Basically we wanted to have a logout link, where the user can exit the MapYourBuddies application and also signs the user off from Facebook. See also my posts "MapYourBuddies - And the big Logout Challenge ;)" and "Tiny Addition to the Big Facebook Logout Challenge ;)" and Tom's Post.
The major issue we faced was that this is the way that Facebook offers to sign off a user:
"To enable a user to logout of Facebook, POST to http://www.facebook.com/logout.php, with the parameter "confirm" set to 1."
As a result of this, when we just link to this page, the log off works, but then the user sticks with the
logout/login page from Facebook.com and there is no way for the user to come back to our
MapYourBuddies application. And this is what we wanted to avoid.
The most elegant way would obviously be, when we could have added a parameter to the logout url (like "http://www.facebook.com/logout.php?next=welcome.html") that brings the user back to a specified page. BUT that is with the current API not possible.
The Workaround for the Workaround ;)
Due to this limitation of the API we had to build the first workaround. We now use the "logout" link to load the "Welcome" page. With an "onclick" event for this link we open a new "pop up window" and within this window we submitted the "Facebook logout form" automatically via a JavaScript:
<script type="text/javascript" language="JavaScript">
document.logoutform.submit();
</script>
So far so good. But now we had the problem that we had this open "pop up window" with the logout/login page from Facebook.com. And because we do not have an influence about the Facebook page, we were not able to close this window, after the Facebook page was loaded.
Therefore I build the second workaround: Instead of loading the logout/login page from Facebook.com complete into the "pop up window", we now load a frameset and display a "Good Bye" page (that also closes the window after 10 seconds) and the logout/login page from Facebook.com is loaded in an separate and HIDDEN frameset ;)
<frameset rows="*,0">
<frame src="logoutPage.html" name="Counter">
<frame src="facebookLogout.html" name="Formular">
</frameset>
Basically now the Facebook logout works and we have a neat "Good Bye" page that now closes the "pop up window" and displays with a JavaScript Countdown when the window will be closed automatically. But the user may close the window just by clicking the provided link at the bottom of the logout page.

Now, we also fixed this Challenge. And Thanks again for all your input!
On Wednesday we will present this new feature in our weekly presentation.
-Joern