Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos
Warning MessageWarningLog Off Message

Abstract 

As per the SAP Note: 982982 there is no standard solution in SAP Portal to Logoff the Portal due to user inactivity. Hence people have been using client side solution to overcome this. Upto certain extent this functionality built using Javascript has been useful. With reference to the Portal timeout solution posted by Arnaud Leymet, this post is an enhancement of the Portal user idle timeout solution.

Background of previous Solution :

If user is idle, then the Portal displays a warning message to the user after a certain period (warning period). In the duration between warning period and actual timeout period, if user intervens and clicks on the Warning message, then Portal timer is updated. Else the Portal still remains idle waiting for user intervention. Hence the actual timeout of the application is happenning only after user intervention. Even if the user has not seen the application for n hours the portal would not have logged off.

Hence to overcome this issue, in place of an alert I have used a dialog window prompting the user to activate the portal and will be displayed for few minutes (timeout period - warning period) after which it closes automatically and logs off the portal. Before logging off it opens a new window informing the user about the session termination due to inactivity. The code has been modified for achieving the same.

Source

Open Mashead PAR file through NWDS.

Create a JS page by name customtimeout.js under scripts folder in the project directory and include the same in Headerivew.jsp page.

Add the below code in customtimeout.js

javascript/customtimeout.js

 

For opening a pop up dialog window in Internet Explorer browser after the warning period, create a JSP page by name IEDialog.JSP and add the below code in it .

IEDialog.jsp


The Portal session will expire in 5 minute(s). Please click [Continue/Logoff] to Re-activate/End the session.

  


For opening a pop up dialog window in other browsers after the warning period, create a JSP page by name FFDialog.JSP and add the below code in it .

FFDialog.JSP


Your session will expire in 5 minute(s). Please click [Continue/Logoff] to Re-activate/End the session.





To display a Logoff message after Portal Log off, create a JSP page by name LogoffMessage add the below code in it . 

The Log off Message is displayed, so that user can identify that its a force log off due to session inactivity.  The HTML code for the same is given below.

LogOffMessage.jsp

The Portal session has been terminated due to inactivity. Please login again.



 

Add the below code towards the end of HeaderiView.jsp

(No change done in this page compared to previous)

PORTAL-INF/jsp/HeaderiView.jsp

 

Note: The Idle warn delay & kick delay values can be changed as per the requirement in

customTimeoutHandler(25, 30) in HeaderiView.jsp.

Result:

After being idle on the portal for 25 minutes , you should obtain a popup like the following:

Dialog Window:

Log off message after timeout:

It worked for me. Hope you'll find it useful.

31 Comments