Support the ongoing development of Laravel.io →
Configuration Authentication Session

Hello!

I would be happy if you could help me with the following problem:

When a user does a login, I save some user information (like for example the username) in his (Laravel) session. The expiration time of this laravel cookie needs to be statically set in the config file.

I also use the Sentry 2 framework, to make sure the user is authenticated. He can click a "remember me" checkbox on login, that should cause him to still be logged in, even after the browser was closed. This is implemented by Sentry, which then sets a cookie with lifetime "forever".

The problem is: The Laravel cookie does not know anything about that Sentry "remember me".

Is there any way I can dynamically (!) set the expiry date of the Laravel session cookie? So I could have it set to "forever", only if the "remember me" checkbox was marked?

Thank you in advance!

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.