Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting session timeout value from WebSphere Application Server using Java

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

like image 203
explorer Avatar asked Aug 13 '26 19:08

explorer


1 Answers

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

like image 149
Andres Avatar answered Aug 16 '26 15:08

Andres



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!