Domanda

What would be the best practice to keep the user logged in if he or she refreshes the page? Assume that the user signed in already.

At the moment the gatekeeper is performing its duty but when the user refreshes (F5 , browser button) the page. The user is redirected to the login screen (aka default place).

There is a nametoken in the url to detirmen what presenter should be loaded.

Has anyone found a way to relog the user?

È stato utile?

Soluzione

I will describe what I use to keep user logged in and track in gwt, and maybe this will give you a hint:

For Session Tracking I have a singleton MySecurityManager (initialized with entrypoint) which periodically connects to the server with simple "ping" request and server gives the response if session is expired and also detects as a separate case if you logged in by another user (in another tab).

I implemented Activities and Places support so F5 keep me staying on the same Activity. So when the browser refreshes the correct place is chosen and SecurityManager initialized and checks the session in first turn and if session is ok.

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