Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

[AEM Gems Webinar] Accelerating Experience Manager as a Cloud Service development with Rapid Development Environments
Adobe Summit 2023 | Complete list of AEM Sessions & Labs
SOLVED

Session timeout event handler

Avatar

Level 1

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

1 Accepted Solution

Avatar

Correct answer by
Employee

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

View solution in original post

0 Replies

Avatar

Level 10

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

Avatar

Correct answer by
Employee

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