There are several ways to solve this, depending on the details of each scenario, but perhaps the most common way is to modify the domain in config.php:
app / config.php
domain => '.dominio.com'
After this, you must clean the cookies previously stored for those sites.
Another way, maybe less orthodox but equally simple in case you have only one instance of Laravel for the two subdomains, is to simply direct both public/index.php
files to the same instance, something like this:
In the content of both files, replace the following two lines to the same instance of Laravel, or in other words to the same directory bootstrap
:
app1.domain.com/index.php and app2.domain.com/index.php
// Línea 22
require __DIR__.'/../bootstrap/autoload.php';
// Línea 36
$app = require_once __DIR__.'/../bootstrap/app.php';