Browseable session backend
Presentation
Browseable session backend (Apache::Session::Browseable) works exactly like Apache::Session::* corresponding module but add index that increase the speed of some operations. It is recommended in production deployments.
Note
Without index, LemonLDAP::NG will have to retrieve all sessions stored in backend and deserialize then filter each of them.
Warning
A search on a field missing from the indexes doesn’t fail: it reads the
whole session storage. On a large storage, frequent searches of this kind
(ProxyID is searched for each SAML authentication response) can
saturate the portals.
The following table list fields to index for each session type:
List of fields to index by session type
Session Type |
Fields to index |
|---|---|
Sessions (global) |
_whatToTrace _session_kind _utime [1] ipAddr user [3] mail [4] _session_uid [5] _oidc_sub [6] _oidc_sid [7] |
Persistent sessions |
_session_kind _session_uid _webAuthnUserHandle [8] ipAddr _whatToTrace [2] |
CAS sessions |
_session_kind _utime [1] _cas_id pgtIou auth_cas_ticket |
SAML sessions |
_session_kind _utime [1] _saml_id ProxyID [9] _nameID _assert_id _art_id |
OIDC sessions |
_session_kind _utime [1] user_session_id _whatToTrace [10] _type [11] _session_uid [12] ipAddr [2] |
Note
If you have configured LemonLDAP::NG to use something other than _whatToTrace as the main session identifier, you must replace _whatToTrace with the new session field in the previous list
See Apache::Session::Browseable man page to see how use indexes.
Tip
It is advised to use separate session backends for standard sessions, SAML sessions and CAS sessions, in order to avoid unused indexes.
Attention
A separate backend uses its own options, so its own Index: the SAML
searches use the Index of the SAML sessions module options, not the
one of the global sessions. Conversely, without separate backend, the
SAML, OIDC and CAS sessions are stored with the global sessions: their
fields must be added to the Index of the global sessions. This is
the default for the OIDC sessions, so for the refresh tokens.
Attention
With a backend storing the indexed fields in columns
(Apache::Session::Browseable::MySQL for example), each field of
Index is a column written at each session save: add the column
before adding the field to Index, and remove the field from Index
before dropping the column, otherwise every session save fails. The
provided schemas create the SAML, OIDC and CAS columns only in their
own tables.