elic-dev/laravel-site-protection

Modify Session Timeout

Closed this issue · 9 comments

Hello,

Is there a way of modifying the default session logout timeout, so I could set it to 30 days or something without having to log in again?

Thanks
Josh

Based on the middleware, this is currently set in the setcookie function. When set to 0 it times out at the end of the session (when the browser closes). Doesn't look like this is linked to a config variable, but I can submit a PR that would do so if you'd like!

L1lle commented

Hi,
I kinda missed the notification about this issue. Sorry. I've changed the value from '0' to at last a year. I did not use a config value, to keep this as simple as possible.

If that's alright @joshhawkes, I'll give it a tag and release a new version for composer.

Personally I think it would be more useful if it were configurable. Not everyone wants it to be 0, not everyone wants it to be a year.

Thanks both, I agree it would be more useful to have it configurable, especially for other users.

L1lle commented

Ok, I agree with everyone.

I'll add a config option for cookie lifetime next week (on vacation) and will release a new version as well.

Thanks for the input.

L1lle commented

Hi. sorry for the delay. I added a config value and env param to change the cookie lifetime to a custom value. if this looks alright. I will release this as a new version as soon as possible. thanks for the feedback.

Yeah! This is great :)

L1lle commented

Cookie lifetime setting has been released as a new version 1.2.0. Thanks everyone for the feedback.

Thanks so much for this :)