cancel
Showing results for 
Search instead for 
Did you mean: 

How to show a message on login screen if the session is expired

Former Member
0 Kudos

I need to show a session expiry message on login screen if the session is expired.

Suppose user is on homepage after login. He kept open the page for a long time without any activity on the page. In the meantime if the session is expired and user refreshes the page, it should redirect to login page and a message should be displayed at login page "Your session is expired. Please login again". But if the user closes the browser when the session has expired and opens the login page in new browser window, then at time message should not be shown.

So how can I identify that session is expired and user has refreshes the page.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

you have the scope for request in this class. Check the session id. if session is timedout then the session id or guid will be null.. otherwise it will return session id. based on that u can decide session is active or not.

Former Member
0 Kudos

Hi Vinay,

How will you check if the session is timed out in RequireHardLoginBeforeControllerHandler.java:beforeController() method.

Former Member
0 Kudos

add annotation on your HomePageController.java::home method as @RequireHardLogIn. then go to RequireHardLoginBeforeControllerHandler.java:beforeController() method. If you find session timeout then pass informative message or error message to view to display the message.

Hope this helps.

Thanks Samudrala