I am trying create a simple “login” / “logout” page.
The server side is running Tomcat.
By following This Link, I successfully utilise the internal authentication mechanism of Tomcat to let user login.
But how can I implement the “logout” button? What should I do if the user click the “logout” button? How can I tell Tomcat that user wants to logout?
Logout Link/Button must do following things:
invalidate()thesession.cookies(if any).beanobject (if any).Also if any database value is related to user’s login/logout then set it to appropriate value.
Below are some answers that may help you further: