Session timeout event handler | Community
Skip to main content
New Participant
Jan 26, 2018 12:40 PM UTC
Solved

Session timeout event handler

Hello

I am using AEM 6.2 and have implemented AuthenticationHandler interface and extended DefaultAuthenticationFeedbackHandler to handle the authentication.

This is working nicely and now I want to enable the browser to detect when the session times out so that I can warn the user and then show the appropriate message/screen.

Is this possible? How can I do this? Any example/pointers will be very much appreciated.

Regards

John

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
abhishekagg19Accepted solution
Employee
Jan 28, 2018 4:15 PM UTC

An inactivity based timeout has to be implemented using custom js code.

A timer can be started on the load of page, and the same should be reset on "mousemove click keydown" events (or as per requirement).

If there is no user activity for a fixed amount of time, then js code can set window.location.href = "/system/sling/logout" and also perform any cleaning up activity, like cookies, browser memory etc.

Regards,
Abhishek Aggarwal

2 replies

abhishekagg19Accepted solution
Employee
Jan 28, 2018 4:15 PM UTC

An inactivity based timeout has to be implemented using custom js code.

A timer can be started on the load of page, and the same should be reset on "mousemove click keydown" events (or as per requirement).

If there is no user activity for a fixed amount of time, then js code can set window.location.href = "/system/sling/logout" and also perform any cleaning up activity, like cookies, browser memory etc.

Regards,
Abhishek Aggarwal

Translate
smacdonald2008
Level 10
Jan 26, 2018 2:05 PM UTC

To detect browser activity - you should be able to do it like a non-AEM solution.

Translate