Are you actually using the Database to store sessions? If not then you can't.
Otherwise, you could just query the database. See the Laravel documentation.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'd like to access the last_activity value from the session (https://github.com/laravel/framework/blob/d3c96686c36c0681cb01251c32f2fc3291d49c6b/src/Illuminate/Session/DatabaseSessionHandler.php#L112) - can I get this, or do I have to extend DatabaseSessionHandler someohow? How would I do that?
Please or to participate in this conversation.