3

Is it possible to get session timeout value set in WebSphere Application Server from Java code dynamically?

I need to show an alert 5 minutes before the actual session expires. Please suggest.

Thanks

informatik01
  • 16,038
  • 10
  • 74
  • 104
explorer
  • 1,074
  • 2
  • 11
  • 31
  • Since it's from server config, I had a thought that we may be able to get it using Java Code.Is it possible to detect all keypress events with javascript ? Considering that I know the session timeout in advance, I can run a timer manually and show the alert if the application is idle. – explorer Jan 04 '14 at 17:34

1 Answers1

4

You can get the session timeout with the funcion getMaxInactiveInterval().You can also get the timestamp of session creation using a Listener that stores that value on a Session scoped variable. If you query both values from the browser, you can activate a timer that solves your problem.

For the timeout: http://docs.oracle.com/javaee/1.2.1/api/javax/servlet/http/HttpSession.html

For the listener (watch SessionLifeCycleEventExample): http://docs.oracle.com/cd/B14099_19/web.1012/b14017/filters.htm

Andres
  • 10,561
  • 4
  • 45
  • 63