GWT-Platform login + session management

后端 未结 3 2024
时光取名叫无心
时光取名叫无心 2020-12-10 19:38

I am new to gwt and I am creating a login page using gwt and I need help with session managment.

All answers already given here, explains how to manage sessions on s

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-10 20:09

    If you mean controlling instance of HttpSession on client-side, simply you cannot control the session on client-side since it lives on server-side. For controlling the session you have to call to the server-side with asynchronous callbacks or with another technique. Read this tutorial: Communicating with a Server in GWT On server side implementation you can set any attribute to session

    HttpSession session = this.getThreadLocalRequest().getSession();
    session.setAttribute("UserName", userName);
    

    Or if you mean Client side web sessions, you can control them with Cookies.

提交回复
热议问题