Redirect to login form if session is not exist anymore

Hello,

we have some pages protected by front end login (Globit.UserManagement plugin). After login user can see this pages. If the user still not using the page and time out happened the session will be closed. After click on some other protected page or reload this one the user see 404 page.

Page Not Found

Sorry, the page you requested was not found.
#1430218623: The requested node does not exist or isn’t accessible to the current user

This ok, because the user has no rights for this page anymore. But instead i wish to forward the user to login page. So it can login again and see the page.

I tryed already to add to Settings.yaml something like this:

error:
exceptionHandler:
defaultRenderingOptions:
templatePathAndFilename: ‘resource://Globit.UserManagement/Private/Templates/Authentication/Index.html’
renderingGroups:
‘notFoundExceptions’:
options:
templatePathAndFilename: ‘resource://Globit.UserManagement/Private/Templates/Authentication/Index.html’
layoutRootPath: ‘resource://Globit.UserManagement/Private/Layouts’
format: html

Maybe the documentation on authentication entry points can help?

We at networkteam had a similar issue. We have created a frontend login package which addresses the issue you discribe. It is still work-in-progress but should work in production.

The package takes a different approach than the link @kdambekalns suggested. It is more content based.
I hope it helps.