Auto Reload Client Page
I am new on gxt and gwt , I have the following:
If a user is currently logged in and the session is still open, when he come to login again from another place I want to make a force logout operation for the previous session and display the login screen again (sure for the old place, to close the web application).
how can i reload just single node but not whole tree....plz reply...
I am new :((
in fact I am new with gxt and gwt ... i do not know how to do this, but if I know it I will replay to you, insha'Allah
now who will replay to my post :))
One way to do it is like this:
- On the server create a table in your database that will store current sessions (user and session ID)
- When user successfully logs in store session ID and user name in the current sessions table.Then send back session ID to the client application.
- Client application should include user name/session ID with every RPC call to the server.
- Server code should validate user name/session ID against current session table. If session check does not match an exception will be thrown.
When user logs in from another computer check if there is already an active session for this user in the current sessions table. If there is then ask user if he wants to continue with the new session. If user says yes, delete user's existing record from current sessions table and then create a new session record.
When user tries to work on the computer with old session he will get an error on the next call to the server because old session record has been deleted. Your client application can then display the login screen.
This way only one active session for the user can exists.
Have you already found a solution for this?
I also need to have this implemented in my web app.
gaspo100's way would be the cleanest way of handling this issue. If you dont have access to the database to create a table, you could use a singleton instance of a new class as well, holding a hashtable of user to session.
Each time a service is called, it should check the user and the session, and if it doesn't match what's in the hashtable, then you can deal with that how you would like.
I've already implemented mine.
For those who are looking for an alternative:
In my app I don't logout the previous tab but I automatically logged in using the credentials from the most recent session (remember me). I also store the recent session info in my browser's cookies
I pass the user credential info every RPC using a custom RPCRequestBuilder:
Thanks a lot!
I just want to say thank you for the information. It is very valuable for me..newbie here and encountering generic levitra the same situation.
Thanks and keep up the good work..