cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to check whether session is timed out in hybris? without using cartService..

former_member1573
Participant

Accepted Solutions (0)

Answers (1)

Answers (1)

Marko_salonen
Contributor
0 Likes

Hi, there are really no methods to check if the session had timed out or not because you will always have a session. What is the exact use case? There is one thing to consider and that is to use hasSessionCart() method from CartService to check if there is a cart before actually getting it in those situations that you would not like to have cart created.

former_member1573
Participant
0 Likes

We need to handle a case when session times out after X seconds of inactive time.

Marko_salonen
Contributor
0 Likes

Easiest (most hybris friendly) would be to use a HttpSessionListener in tomcat. You would get the HTTP session and from It's session you have attribute "jalosession" where the hybris session can be identified. This data you could then use to map correct hybris session and do needed logic.