I have a website built on App Engine(Java) and need user use Google Account to login.
The situation is that:
- User Adam has multiple accounts.
- User Adam login with account Adam1 and get his Adam1 data in browser page A.
- He clicked logout link, but opened it in another tab page B(the same browser of course)
- He login with another account Adam2 in browser page B get his Adam2 data shown.
- He then returned to browser page A and made some changes to his data and then send to server, at this time my app would recognize the current user is Adam2 , and the changes would be taken on Adam2, it does not match the status with its current page A, our user may be confused.
I thought maybe I can attach a userID parameter while making change request to the server and server side will compare the current user id with this userID parameter to make the change request processed or return a refresh command to make the out-of-date page be refreshed to the current account's if the ids are not same.
What is the best practice to handle this situation?