Laravel cookies1 of 5 need consent
Laravel sets 5 cookies we know of. 1 cookie may only be set after the visitor opts in; 4 are strictly necessary and exempt.
Reviewed · Provider: Laravel (Illuminate), Laravel (Passport package), Spatie (laravel-cookie-consent)
List of Laravel cookies
laravel_sessionNecessaryNo consent neededSessionStores the encrypted session ID for the current user session. Required for user authentication and form submissions.
XSRF-TOKENNecessaryNo consent neededSessionContains a CSRF token used to verify that authenticated requests originate from the application. Prevents cross-site request forgery attacks.
remember_web_*FunctionalConsent required30 daysStores an encrypted token to remember a logged-in user across sessions when 'Remember Me' is selected at login.
laravel_tokenNecessaryNo consent neededSessionAn encrypted JWT issued by Laravel Passport's CreateFreshApiToken middleware, letting a first-party single-page app call your API as the authenticated user without handling access tokens manually.
laravel_cookie_consentNecessaryNo consent needed20 years (default)Records that the visitor has acknowledged the cookie notice shown by Spatie's Laravel Cookie Consent package, so the banner is not displayed on subsequent visits.
How to handle Laravel cookies
- 1Load it only after consent
Hold the Laravel script until the visitor accepts functional cookies. Blocking the script is what stops the cookies; hiding them in a banner does not.
- 2Make Reject work
After a visitor rejects, none of the 1 consent-requiring cookie below may be set or kept.
- 3Name every cookie in your policy
List each cookie by name with its purpose, provider (Laravel (Illuminate), Laravel (Passport package), Spatie (laravel-cookie-consent)) and lifetime.
- 4Check the result, not the settings
Open your site in a private window, reject cookies, and look at what was stored. Or run a scan and compare the three stages.
Tools that help: tracking script blocker · Consent Mode v2 generator
Other vendorsAnd the cookies they set
Does Laravel wait for consent on your site?Scan it in 2 minutes
Free scan · every cookie before consent, after Reject and after Accept