Laravel 13 Upgrade Guide: Check CSRF, Session Serialization, and Framework Defaults
Laravel 13 keeps the annual release cadence and the framework’s upgrade tooling continues to improve. Its official guide estimates a short upgrade for typical applications, but a quick dependency update does not replace checking how the application uses framework behavior.
Begin by updating the PHP and package constraints listed in the versioned guide. Run the application test suite before addressing deprecations; that gives you a baseline for separating dependency failures from behavior changes. Review the guide’s impact labels and search the codebase for direct references to affected framework classes rather than applying every listed change mechanically.
Two checks deserve special care:
- Request forgery protection: the CSRF middleware has a new name and adds request-origin verification using the Sec-Fetch-Site header. Update direct references in middleware exclusions and tests, and verify browser, mobile, and cross-origin API flows deliberately.
- Session serialization: the new skeleton defaults to JSON serialization. Syncing that configuration into an existing app can invalidate sessions. If active sessions must survive the release, understand the configured serializer and plan the transition; if session objects are not required, JSON may be an appropriate security improvement with an intentional re-authentication window.
Also compare cache prefixes, session cookie names, database upsert behavior, queued job payloads, and any custom manager extension callbacks. Upgrade dependencies in a branch, run migrations and tests against a production-like database, deploy to staging, and observe authentication, queue, cache, and upload behavior before promoting the release.
Laravel’s 13.x upgrade guide is the authoritative checklist. It includes high-, medium-, and low-impact changes and a Boost-assisted upgrade prompt; treat generated edits as a draft for review, not as proof of compatibility.