Domanda

I have an appengine application that works with google logging system. The services i propose are based on the user account and linked to it (for instance, saving the user's work on his account).

I noticed that it breaks my app when the user logout from a google service on another tab (for instance, gmail). When coming back to the tab of my website, things don't work anymore, the user is logged out here too.

I'd like to know when the user is logged out and execute some javascript code without having to do some polling on my application that will increase the appengine costs.

What solutions do i have for that ?

È stato utile?

Soluzione

You can use the Channel API and open a channel that waits for a message when you get logged out.

However, Channel API calls are pretty expensive, so this could end up being more expensive.

The cheapest way to go would be to return a particular error code if you're logged out, and handle that error code across all your AJAX calls.

Altri suggerimenti

You cant without polling unless you write a browser extension that alerts your tab (hard and varies on browser brand). The behaviour you see is expected. They log out of their google account, not the website. You could also poll only when the user selects your tab instead of always.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top