When you say Both applications are on the same domain, but B is a subdomain and is not part of the same project as A. can i safely assume that they are two separate installations of Laravel, but they share the same database? I that's the case, you could try this:
- Switch the session driver to database in your
.env file to "database", for reference you should look at the comments in config/session.php, near the 'driver' => env('SESSION_DRIVER', 'file'), option. Be sure to manage the tables accordingly (see https://laravel.com/docs/5.5/session#driver-prerequisites)
- In your
.env file, specify this row: SESSION_DOMAIN=.domain.ext (notice the dot near the equal sign).
Alternatively, if even the databases are separate you could try the same config as above using the cookie driver instead fo the database. let me know if this helped.
edit: more a suggestion than an answer, laravel is capable of handling multiple websites/domains natively (example: Route::domain('sub.domain.ext'). Pratically speaking, you organize the routes this way in routes/web.php. With a wise database management (and queries) you can easily mantain 2 separate websites within 1 Laravel application. This assuming you have control over your webserver, of course. If that's the case, i would suggest a refractoring. It's really worth the effort.
Auth::login($user);or something similar?Request $requestand see if it contains the token.*.mydomain.foo. Perhaps something like this: stackoverflow.com/questions/34488477/…