Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

benjah's avatar

Session time out n laravel 5.1

hey everyone, can someone please tell me what is the default timeout for sessions in Laravel 5.1 and if there's a way to change it? thanks a lot :)

0 likes
5 replies
Swapnil's avatar
Swapnil
Best Answer
Level 11

try in config/session.php

'lifetime' => 120,
13 likes
Jdev's avatar

if i want to do an ajax request every minute to find out if the session has expired without renewing the expiration time of the session, how would i go about doing that?

juanvillegas's avatar

Just do a ping to a dummy API endpoint that requires auth, and if the response's code is other than 200 (like a forbidden or whatever), then your session's expired.

Please or to participate in this conversation.