java - Sessions keep getting lost on mobile browsers -
currently, setting user sessions on java (with jsp on struts 2 framework) following code:
httpsession session = request.getsession(true); sessionbean sessionbean = new sessionbean(); session.setmaxinactiveinterval(604800); sessionbean.setuserbean(userbean); session.setattribute("sessionbean", sessionbean);
this session terminated when user explicitly logs out following code:
httpsession session = request.getsession(true); session.removeattribute("sessionbean");
while sessions automatically expire after 1 week (604800 seconds) of user inactivity.
the above works fine , dandy on desktop browsers. however, on mobile browsers (observed on iphone safari , android's default browser), session expires after page idle 30 minutes or more.
i replicated problem following steps:
- opened page on iphone safari, left page idle , closed iphone safari (with still running in background).
- reopened iphone safari 30 minutes later.
- the page refreshed , when did so, session lost.
how preserve sessions on mobile such user stays logged in unless explicitly logout (or session expires within standard 7 days of inactivity)?
thanks in advance!
Comments
Post a Comment