1

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?

Jackson Tale
  • 25,428
  • 34
  • 149
  • 271

1 Answers1

2

Logout Link/Button must do following things:

  1. invalidate() the session.
  2. Clear up the cookies (if any).
  3. Reset the bean object (if any).
  4. Get redirected to custom logout message page or home page of application.

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:

Community
  • 1
  • 1
Asif
  • 4,980
  • 8
  • 38
  • 53