Reputation: 107
I have a project on Laravel 5.4 and PostgreSQL. At each page request, the session is renewed with a new _token
key and a new cookie. As a consequence, either authentication nor flash sessions message are not working.
Already tried :
$domain
variable in session.php, tried null, http://localhost:8000 and http://localhostencrypted => false/true
and all others booleans fieldsroutes.php
file, replaced middleware
by middlewareGroups
The RouteServiceProvider.php :
protected function mapWebRoutes(Router $router)
{
$router->group([
'namespace' => $this->namespace, 'middleware' => 'web',
], function ($router) {
require app_path('Http/routes.php');
});
}
(there is no web.php/api.php, etc... PHP files, the developper remapped all these files into routes.php).
Upvotes: 1
Views: 1156
Reputation: 670
Your browser will not store cookies for a domain without a dot. E.g. localhost. A simple fix is to add 'localhost.com' to your hosts file as 127.0.0.1.
Then you can use for example: localhost.com:8080
Upvotes: 1
Reputation: 1430
Your domain is invalid. You need to look at config.session.domain
and config.session.path
.
Upvotes: 1