Is there a way to rename Laravel's remember cookie prefix "remember_web_*"?
I have 3 Laravel projects on the same server, can be accessed by IP address, ports distinguish the projects. However, because of cookies are shared between ports, all projects read all cookies, every project can distinguish its own session cookies, but remember token cookies can't be distinguished. So only one project's session can be remembered at the same time.
Is there a way to rename Laravel's remember cookie prefix "remember_web_*"?
You'd have to create your own
SessionGuardwhich extends from the original since there is no option to define this cookie name. It might be worth a PR for the original framework though.Step 1: create an override for the original SessionGuard:
Step 2: add the guard to the bootstrap:
Step 3: define the new guard in
config/auth.php:When logging in with remember-me checked, the new cookie name should now be used.