Expand my Community achievements bar.

SOLVED

doFilter - all request coming through it - will this cause performance bottle neck

Avatar

Level 4

Hi everyone.

 
My requirement is to forcefully logout user after some specific time (say 12 hrs). For logging out we will delete the user cookie created during login. We are thinking to use doFilter to achive this. When a user logs in we will add timestamp to user cookie and then on every subsequent request we will check current time - user login time > 12 then we will delete the user cookies.
 
This doFilter code is working fine. I am getting what I need.
 
But what I observe that now every request to CQ is coming to this Filter. Will this cause performance issue on production since any activity on site will come to doFilter ? Is there any other better way to achieve this ? 
 
Any setting I can do in doFilter ?

 

Thanks in advance.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

If you register a filter on a request level, every request going to this instance will go through this filter.

Regarding your specific usecase: When a user is logged in, a ".tokens" node is created in the user home. If you remove this note, the user needs to relogin.

Jörg

View solution in original post

1 Reply

Avatar

Correct answer by
Employee Advisor

If you register a filter on a request level, every request going to this instance will go through this filter.

Regarding your specific usecase: When a user is logged in, a ".tokens" node is created in the user home. If you remove this note, the user needs to relogin.

Jörg