Thread: login application using servlet jsp for admin/user?

Forum : Servlets   31-10-2017 01:22:02 PM
User Image


Joined: Aug 7, 2017

Points: 100

Threads: 6

Posts: 5

Answer Icon login application using servlet jsp for admin/user?

| Quote Date : Oct 31, 2017    Views:1033    

I am building an login application for admin and user , how can I use session for logout , so when I go back the page user profile should not display.. please answer .?

tags: servlet


User Image


Joined : Apr 20, 2017

Points : 145

Threads: 9

Posts: 57

Answer IconRe: login application using servlet jsp for admin/user?

Reply Date : Nov 6, 2017

Session Invalidating:
   There are two ways of invalidating a session.
   -->Programmatic approach
   --->Declarative approach
   Programmatic Approach:
                    We can use session.invalidate() or session.setMaxInactiveInterval(seconds).By default for every server the default time out is 30 ms.
Declarative Approach:
                We can configure these tags in web.xml.

  In order to not display the profile when back button is pressed.We should block the back button which is commonly used in banking applications.
 This can be achieved multiple ways one of the way to use in java script is

   <SCRIPT type="text/javascript">
function noBack() { window.history.forward(); }
<BODY onload="noBack();"
onpageshow="if (event.persisted) noBack();" onunload="">?

Load More

No More Comments