Hello, I've got this problem with the Auth::user()
object not working properly when using subdomains.
I'm running my local development website using XAMPP on localhost and I've got the subdomains admin.localhost and boards.localhost.
/*
|--------------------------------------------------------------------------
| Session Cookie Domain
|--------------------------------------------------------------------------
|
| Here you may change the domain of the cookie used to identify a session
| in your application. This will determine which domains the cookie is
| available to in your application. A sensible default has been set.
|
*/
'domain' => false,
I get the error trying to get property of non-object. I've made multiple google searches and looked through various pages but nothing has solved my problem. I've tried these variations:
'domain' => 'localhost'
...
'domain' => '.localhost'
...
'domain' => '*.localhost'
but no better results from that. Could someone guide me to a proper solution or is a custom solution required?
I think it should be
'domain' => '.localhost'
However if the cookie was set before you made this change you probably need to delete them or clear browser cache
Using
'domain' => '.localhost'
Laravel doesn't create any cookie, and I still can't authenticate.
Using
'domain' => '.localhost'
Mozilla Firefox does authenticate but Chrome and IE11 doesn't. However Firefox can't connect to subdomains like admin.localhost for some reason that I can't figure out
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community