go to config/session.php and set (without www)
'domain' => env('SESSION_DOMAIN', yourdomain.com),
and in console
php artisan cache:clear
composer dump-autoload
Delete all cookies from browser
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi guys, I asked about issues with Google oauth a while back but got no answers, and made some progress in the meantime.
I have facebook and google login using socialite, facebook works but google I've only managed to get to work locally, so for example locally the url is http://dev.thesite.com and in production the url is https://thesite.com, that's the only difference, however when trying to log in with google in production i always get the invalidState exception
I managed to make some "progress" by setting the callback url to be https://www.thesite.com//login/google/callback instead of just /login/google/callback and also having www in the url in the google api console for the callback, then I don't get an error but I am redirected wrongly to /index.php and I am not really signed in.
My .htaccess files redirects all requests to https, I believe that maybe some server setting is the issue here, did you guys have any similar experiences?
Please or to participate in this conversation.