'Hidden Sign out from all Google accounts in my website

I need to force my users to Sign out from all their Google accounts. I have a link which can do that:

https://www.google.com/accounts/Logout

And also I found a way in javascript how can I trigger this link:

new Image().src = "https://www.google.com/accounts/Logout";

Everything works except incognito mode and Firefox webbrowser. The result in Web browser console is exactly the same in both situations and also it triggers that endpoint cause I can see entries in Networking which response with status 200, but I am still sign in with accounts.

Do you have any idea what might be wrong? There is no error in console. I do only receive CORS blocked but I don't care about response. I just need to make sure users are logged out before they do next actions in my website.

Do you have any other ideas how can I achieve that? Thanks in advance



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source