Dear Maksym, On 24.08.21 02:39, Maksym Zinchenko wrote:
But lately, user logs in start working and randomly redirected back to the login screen because data in db is not the same as in cache,
when you have values from the DB cached, then whenever the DB changes, you have to flush the cache values. Accessing the DB via "ns_cache_eval" as mentioned in my last mail is the right thing, since it will rebuild the cached values when needed.
When you see this effect just lately, make sure that the cache is large enough (check this via the nsstats cache page). A few releases ago, the memory computation (which previously did not account for the cache keys) was changed, which might lead to a higher nominal cache size value.
If you know any session package or code example I would appreciate tremendously
We are using everywhere OpenACS, which has its own session management, which is non-trivial, since it tries to avoid hacking, implements session refreshes, etc. One other source is Vlads ossweb [1] (which i have not looked into, but Vlad produces usually high quality code).
Hope this helps -gn [1] https://github.com/vseryakov/ossweb _______________________________________________ naviserver-devel mailing list naviserver-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/naviserver-devel