Saturday, December 17, 2011

How to log out of a session in jsp and how to make subsequent back clicks be redirected to my login page?

I have simple jsp session.I want user to log in do some work on his portal and then log out.Once he logs out then don't allow him to see his portal by clicking back button in browser.How can i do it.I know how to invalidate sessions.|||You need to know on the server if the user is logged in. You can either add a property to their session that tells you if they are logged in or you can use a database table where you store some id (session or user) and if they are logged in. When a request comes in, you always check that property or table to see where to send the user. If you are using a servlet with your JSP, this is normally done with a Servlet Filter. It is a small piece of code that performs a task before the servlet is called. See http://java.sun.com/products/servlet/Fil鈥?/a> Good luck.

No comments:

Post a Comment