As I've spent a huge amount of time on this google login/logout issue for my app (which is a Node/MongoDB server, using massively Google Docs and Google Script APIs), I had to share my results here..
The only good way to completely logout the user is to use this :
var newWindow = window.open('https://mail.google.com/mail/?logout&hl=fr','Disconnect from Google','width=100,height=50,menubar=no,status=no,location=no,toolbar=no,scrollbars=no,top=200,left=200');
setTimeout(function(){
if (newWindow) newWindow.close();
window.location="auth/google";
},3000);
If you use the solution gave above by ira, it is doing a partial logout it seems for the current tab of the browser. Meaning that if the user close the tab, and reopen the application, he will be still logged to the previous account.
I had to use an external window because I was not able to redirect correctly to my app after logout from email google account. This solution works most of times, if user bandwidth is not too slow, letting 3 seconds to the logout being done before closing the popup. Then user is required to log with another account in my main window app.
This confirms the solution of floccinaucinihilipilification and maybe the iframe solution given above should be better than mine.