I'm developing a webapp, purely on JS and Rest WS. Deployed on Weblogic. Using FORM Auth for Login and Session Invalidate for Logout.
For session timeout I've two logics
1) web.xml session timeout configuration
2) JS timer, that checks for click or keypress event else calls Logout servlet with param as sessiontimeout
Now the problem is, Say the user is Active at client side by accessing JS files but hasn't made any REST WS calls, I cannot show any notification to USER as the SESSION is timed out. This is because of Logic 1, that does not allow me to configure any way to specify which page to redirect or pass any request parameters.
Logic 2 works fine, the moment the client is inactive for 30 mins it calls Logout?sessionTimeout=true servlet with request params from Client, which solves my problem. BUT this happens very rare like 10 in 100 cases and 90 times its Logic 1.
The only solution I can think of is remove web.xml session config and just have JS session timer check and invalidate if TRUE. BUT is this a correct approach/design ?
Experts please share your thoughts.