Changing SESSION_DOMAIN variable of existing Laravel App to allow
I have an existing site setup using SESSION_DOMAIN=domain.com
I want to change this to SESSION_DOMAIN=.domain.com so that sessions will persist across sub domains as well as the parent domain.
When I made this change people stopped being able to login, i've struggled to track exactly why in the code but I think it's essentially because they wind up with the same cookies being set twice with the same name, once for ".domain.com" and once for "domain.com".
Clearing all cookies via the browser settings fixes the problem but of course I can't ask all users to do that.
The only way I can think to get around this is to have a middleware with raw PHP that removes any "domain.com" cookies before it does anything else.
But this whole thing is feeling very scary as I could see visitors locked out and I won't know or be able to debug their specific browser.
So I thought i'd post here and see if anyone else has modified their SESSION_DOMAIN variable in the past and has any experience to share?
Please or to participate in this conversation.