Support the ongoing development of Laravel.io →
Configuration Security

I would like to have a unique xsrf-token cookie for my environments like app_env:xsrf-token. Is there a config I am missing? it looks hard-coded to me.

I was sent here bycsrf https://github.com/laravel/ideas/issues/2621

Last updated 3 years ago.
0
moderator

You can extends the default VerifyCsrfToken middleware and overwrite the functions that are pointed out in that issue to use another cookie name.

That middleware can be placed on your routes in stead of the default version.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

matt s msporleder Joined 9 Jul 2021

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.