开发者

How to log out a user from a GWT application?

开发者 https://www.devze.com 2023-01-20 19:02 出处:网络
I develop an GWT applicationwith HTTP basic login type. I have a \"Logout\" button that calls a server side method logout()

I develop an GWT applicationwith HTTP basic login type.

I have a "Logout" button that calls a server side method logout()

public void logout() {
  getThreadLocalRequest(开发者_运维问答).getSession().invalidate();

}

after the call it executes

 Cookies.removeCookie("JSESSIONID");
 Window.Location.reload();

in order to reload the page and get a browser's login screen.

But when the page reloads, I'm still logged in. Why ?


Well, Logout is a common problem for basic HTTP authentication.

Ref. Logout with http basic authentication and restful_authentication plugin

if the user logs in with basic auth, he/she will have to close his/her browser window to logout.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号