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

onurzdgn's avatar

Session Expired Time

Hi everyone. I want to show user auto logout time (session expired time). How can I access user session. This is my login controller:

            'systemUserName' => ['required'],
            'password' => ['required'],
        ]);
 
        if (Auth::attempt($credentials)) {
            $request->session()->regenerate();
 
            return redirect()->intended('/users');
        }
 
        return back()->withErrors([
            'email' => 'The provided credentials do not match our records.',
        ]);
0 likes
2 replies
MohamedTammam's avatar

That's how you get the session lifetime in minutes.

Config::get('session.lifetime')

With each new activity the session renews the lifetime.

Snapey's avatar
Snapey
Best Answer
Level 122

there is no auto-logout. There is a time after which your session is no longer considered valid. Any requests puts the session expiry back to its initial value, eg 120 minutes from now.

Please or to participate in this conversation.