Destroy Session in JSP

I'm new to JSP. I created a set of pages in a web application using the login system.

I want to make an exit option, and it should appear on every page.

I need the full source code.

+5
source share
1 answer

Use a session object in the JSP to end a session.

session.invalidate(); 

UPDATE

Create a separate header page and select the exit option when the user is logged in. After clicking on the sign, do what I told you.

After the session is destroyed, redirect the user to the home page.

response.sendRedirect("home.jsp");
+7
source

All Articles