This code comes from
https://www-10.lotus.com/ldd/ddwiki.nsf/dx/How_to_keep_XPages_Session_Alive_without_using_Extension_Library
<xp:scriptBlock id="KeepMySessionAlive">
<xp:this.value><![CDATA[
var dbpath = '#{javascript:facesContext.getExternalContext().getRequestContextPath()}';
var sTimeoutSec = (parseInt('#{javascript:context.getProperty("xsp.session.timeout")}' || 30) * 60) - 30;
if(!XSP.keepAlive)
{XSP.keepAlive=function xe_ka(){
setTimeout('XSP.keepAlive()',sTimeoutSec * 1000);
dojo.xhrGet({url:dbpath + '/xsp/.ibmmodres/ping',
handleAs:'text',
preventCache:true});
};
setTimeout('XSP.keepAlive()',sTimeoutSec * 1000)}
]]></xp:this.value>
</xp:scriptBlock>
There are other scripts availabel that use partial refresh but they bring up horrible looking ajax errors.