I have solved this issue calling this function when the user click on the logout link:
var logout = function(){
document.location.href = "https://www.google.com/accounts/Logout?continue=https://appengine.google.com/_ah/logout?continue=http://www.example.com";
}
When the user click on the link, the browser redirect the user to the logout page and only when the logout is complete, the user is redirected to the site “http://www.example.com”.
I hope this can help.