How to properly logout of a Java EE 6 Web Application after logging in

前端 未结 3 634
野的像风
野的像风 2020-11-30 01:50

A pretty simple requirement. After logging into web J2EE 6 application, how can I have the user logout again?

Most (all?) the books and tutorials I have seen show h

3条回答
  •  一向
    一向 (楼主)
    2020-11-30 02:34

    You can do it programmatically using the logout()-Method of HttpServletRequest. There is also a corresponding method for login in with username and password. These methods have been added in Servlet 3.0, so they're available in Java EE 6.

    A timeout is a different beast and can be specified in web.xml as following:

    
      30 
    
    

    The time unit is minutes.

提交回复
热议问题