I will try to formulate the problem as clearly as possible.
I added to the site DbSession (as advised here ) , so that it records the last activity of all users. The problem is that with one request from any user, there is a huge number of records (the old session is deleted, a new one is added, and so many times). Over several days of developing the site, I discovered that the table identifier stopped at almost 8 million.
And another indirect problem.
If a user is registered, DbSession itself determines the user from the table and updates his last activity (but a huge number of calls to the database remains). If the user is not registered, then a huge number of times the session is deleted and added again.
It is necessary that one request occur in DbSession with one request, or that it is possible to identify non-registered users and also only update the session without deleting and adding a new one. And better this and that :)
How can this be implemented?