Laravel 4 session doesn't expire after lifetime limit

前端 未结 1 1324
忘掉有多难
忘掉有多难 2020-12-21 01:27

I\'ve set \'lifetime\' => 10 in my session config file, but it doesn\'t expire at all.

In laravel 3 with that setting, after logging in, when limit o

相关标签:
1条回答
  • 2020-12-21 01:49

    I've got it. The problem was with the config pair lifetime and expire_on_close.

    If expire_on_close is set to true, laravel 4 will ignore lifetime. I had:

    'lifetime' => 1,
    'expire_on_close' => true,
    

    and in this case, session was valid after 1 min - it would only expire after closing browser. I changed it to:

    'lifetime' => 1,
    'expire_on_close' => false,
    

    and now session is expiring after 1 min. no matter if browser is closed or not - close enough to what I've wanted.

    The reason why I was confused and haven't figured it out earlier was that the comments there are unclear in that matter and that in Laravel 3 it worked differently...

    0 讨论(0)
提交回复
热议问题