Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session timeout

Status
Not open for further replies.

Kendel

Programmer
Joined
Apr 24, 2002
Messages
1,512
Location
US
Hi All,

Is it possible to get the JSP session timeout by JavaScript?
This will work for ASP.
Code:
<script language="javascript">
function confirmLogoff() {
  if (confirm("Your session will end in one minute.\n\nPress OK to continue for another ten minutes.")){
  location.reload();
  }
}
setTimeout("confirmLogoff()", <%= sessionTimeout %>); 
</script>

This: <%= sessionTimeout %> won't work for jsp.

Thanks.
 
Thanks. This is what I need: <%=session.getMaxInactiveInterval()%>
 
I got the popup as soon as I login. I've tried to hardcode it:
setTimeout("confirmLogoff()", 120) but it still popup right away.
 
Oh, I thought the setTimeout function is in secconds. Than you Dan.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top