Custom session timeout popup message in ADF/ Webcenter portal

Hi All,

In ADF and webcenter applications sometimes we have a requirement to show custom session time-out message.I have tried A team article approach as mentioned but this is not working for me in webcenter not even in portal framework or run time portal. So I have tried something to handle this. In ADF application normally we have a popup before session time out and one after the session is expired.

So I need to disable standard warning message for expiry. I did that like below.

To disable to warning for session time out –

Add these entries in web.xml as



Fair enough. Now you will not see any ootb warning before session time out.But I need a customized session time out popup.Following is the solution for that.
Add this code in the your page template for ADF and webcenter application.

 <af:resource type="javascript">
     var timeoutID;
    function resetTimeout(){
        if( timeoutID ) clearTimeout( timeoutID );
        timeoutID = setTimeout( ShowTimeoutWarning, 1500000 ); // this is popup will come if user is idle for 25 minutes(25*6000)
    function ShowTimeoutWarning() {
       var popup = AdfPage.PAGE.findComponentByAbsoluteId('pt_p1');;

    document.onkeyup   = resetTimeout;
    document.onkeydown = resetTimeout;
    document.onclick   = resetTimeout;


and in the page template add a popup.You can also skin your popup as you like through normal skinning.

 <af:popup id="pt_p1" animate="default">
           <af:dialog id="tod" title="Warning" closeIconVisible="false" type="ok">
              <af:outputText value="You session will expire in next 5 Minute." id="pt_ot1"/>

Thats it. You can try this in ADF , webcenter portal framework and or runtime portal too.

Happy learning with Vinay in techartifact.

Custom session timeout warning popup in Webcenter portal using jquery

Hi All,

Requirement – To show customised session time out warning popup in webcenter portal builder.

Solution- Edit your template-


In the composer, open web development and add an html markup anywhere in the template.
Edit that markup and add below code as the value.

Below snippet uses normal javascript.

<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>Dialog Box Witout Close Button</title>

<div id="dialog"  title="Dialog Title"></div>
var resetTime_int;
function resetTimer(){
    if(resetTime_int) window.clearTimeout(resetTime_int)
    resetTime_int=window.setTimeout(function (){
    if(document.getElementById('dialog').innerHTML = 'You have ' + (timeoutCount * 3000)/1000 + 'seconds until timeout' ;)     
    }, 1000*60*2)



Following snippet with Jquery

<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>Dialog Box Witout Close Button</title>
<link rel="stylesheet" href="">
<script src=""></script>
<script src=""></script>

<div id="dialog" style="display:none;" title="Dialog Title"></div>
var lefttime=3;
var interval;
interval = setInterval('change()',60000);

function change()
   if(lefttime<=2) {
$( "#dialog" ).dialog( "open" );
return false;

autoOpen: false,
position: 'center' ,
title: 'session',
draggable: false,
width : 400,
height : 200,
resizable : true,
modal : true,


With jquery you can make it more beautiful with these dialog options.

Thats it. You can change the time to show popup for idle user.

Happy learning with Vinay in techartifact