Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Destroy session in JSP [closed]

I am new to JSP. I have created set of pages in web application using login system.

I want to do log out option, and it should be appeared on every page.

Please I need the full source code.

like image 921
Abrah Avatar asked Apr 03 '13 06:04

Abrah


1 Answers

Use the session object in JSP to expire the session.

session.invalidate(); 

UPDATE

Make a separate header page and show sign out option when the user has signed on. After clicking on the sign out then do as I told you.

After destroying the session then redirect the user to home page.

response.sendRedirect("home.jsp");
like image 188
Ajay S Avatar answered Oct 21 '22 09:10

Ajay S