On the cloud platform of Camptocamp, a shared redis is used to store the
sessions of the different projects -> the number of keys is huge, and
using an iterative match kills the performance because of the networking
overhead.
We switch to using redis.key(pattern), and since the pattern typically
has a leading string which will allow redis to find the correct bucket,
the performance should be good.
* lazy_property is deprecated
* Since https://github.com/odoo/odoo/commit/cea66be976c6d0746a972da8a16b7a239d12a462, Session
must be used as a dictionary when setting custom values
* Session default lifetime is now defined in odoo.http, so we can just reuse that
* Handle new session rotation logic (sessions must be findable by the first 42 chars of they key)
* Handle new session key generation for rotation (keys must be longer than 42 chars to handle devices)
The default expiration of sessions is 7 days. With healthchecks run
every few seconds, we quickly have millions of anonymous sessions in
Redis. Allow to define a custom expiration for some sessions and set a
very short one for the monitoring requests.