I would like to implement a functionality that will show that the current user is online on a website. To do that I need to track it somehow. For example, I can use com.vaadin.flow.server.SessionInitListener
, but the problem is that the user session can last for a long time, even if the user is not interacting with the website. Just keeps the browser open. Is there a better approach with Vaadin framework how to implement this?
Asked
Active
Viewed 72 times
0

alexanoid
- 24,051
- 54
- 210
- 410
-
3So is the user _not_ online if it has the browser open at that page? If you only consider activity a measurement for online-ness, then you will most likely have to implement that yourself. – cfrick Oct 29 '22 at 19:58
-
Or change to aggressive idle-detection. Basically telling the user, that you don't want them if they don't interact. – cfrick Oct 29 '22 at 19:59
-
Yes, you are right, thanks - I'll use `SessionInitListener/sessionDestroy` in order to implement this – alexanoid Oct 31 '22 at 14:31