I get CurrentUser from UserService
UserServiceFactory.getUserService().getCurrentUser().getEmail()
It works when. But when I logout, UserService still return same email.
I get CurrentUser from UserService
UserServiceFactory.getUserService().getCurrentUser().getEmail()
It works when. But when I logout, UserService still return same email.
That answers everything. It seems that though you might have already logged out of google service, your browser was still maintaining a cookie for google service. That's why it was throwing the same user email again..
Assuming you're logging in by the usual means for GAE, your browser will end up with two session cookies - one for Google and one for the app.
If you also log out by the usual means (the logout URL from
create_logout_url
), then both cookies are deleted.However, if the user browses away from your app to some other Google service and logs out of Google from there, then the cookie for your app isn't deleted (at least, not for me in Firefox). I'm not sure that it even can be - once the browser is away from your app, quite possibly it won't allow Google sites to touch your app's cookies in any way.
The fix should be to provide a logout link in your app, and for the user to log out using that. If you're already doing that, then I don't know what the problem is...