Skip to content

Conversation

michaelcontento
Copy link
Contributor

Updated getCookieExpirationDate() in Illuminate\Session\Middleware\StartSession to use getSessionLifetimeInSeconds() instead of directly accessing the lifetime config, ensuring consistency between session and cookie expiration times.

Context

Discovered this while working with a custom middleware extending StartSession that overrides getSessionLifetimeInSeconds(). Cookie lifetime wasn't respecting the override (expected behavior), as it was reading directly from config instead.

Tests

No new tests added yet - waiting for feedback first in case the current behavior is intentional. Happy to add tests if the change is acceptable.

…n middleware

Updated getCookieExpirationDate() to use getSessionLifetimeInSeconds() instead of directly accessing the lifetime config, ensuring consistency between session and cookie expiration times.
@taylorotwell taylorotwell merged commit 83b737b into laravel:12.x Oct 3, 2025
65 checks passed
@michaelcontento michaelcontento deleted the cookie_lifetime_should_match_session_lifetime branch October 6, 2025 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants