ibm websphere portal blog,websphere portal, portal blog, ibm blog,websphere blog,websphere tips and tricks, websphere interview questions, portal interview questions, portal faqs

To implement Session Timeout | IBM WebSphere Portal Blog

Pages

Sunday, October 30, 2016

To implement Session Timeout


Place below code in Theme default.JSP if you want implement session timeout using this approach in WebSphere Portal Applicaiton.


SessExpire_Test.JSP


<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
<meta http-equiv="refresh" content="<%= session.getMaxInactiveInterval() %>;url=dummy_login.jsp">
</head>
<body>

<h1>Hi, !</h1>
Your session will expire in <%= session.getMaxInactiveInterval() %> seconds at which time your browser will be redirected to the login page and all  your unsaved changes will be lost.
<br>Test Information!
</body>
</html>



dummy_login.jsp
<%@page contentType="text/html"%><%@page pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"   "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title>
</head>
<body>
<h1>You have reached this page because your session has timed out.</h1>
</body>
</html>