In my module, I need greater session control, beyond simple max_lifetime and other parameters taken from PHP config. What I did was to add a column to the sessions
table that gives me the effective session expiration, which I can compare against to know if to revoke the session. (I also want to "cache" this in the local session, but this is unrelated to the question).
The question is, what is the best way to retrieve the new data from the sessions
table? I can just send a direct DB query, such as:
Database::getConnection()->query('SELECT expires_at FROM {sessions} s WHERE s.uid = :uid', [':uid' => $uid]);
However, is there a built-in service for accessing this table, for greater abstraction?