Is the session stored in a cookie ? in the database ? in a file ?
Laravel 11 session handling problems
I have two repos , one is the caller (Laravel 11) and other is the auth repo (Laravel 10). In theory I send a post request from the caller to the auth api, it authenticates my valid user, logs in, and redirects back to the caller project. The two projects has the same session cookie settings, they are on same domain, etc.
The problem is, even I have valid credentials the auth don't persist the user in session after redirect. We use custom session driver, but between L10-L10 projects this communication works!
After lot of searching I found same solution from diff. sources, thats the following, append StartSession middleware in the app.php:
->withMiddleware(function (Middleware $middleware) {
$middleware->append(StartSession::class); // <- this line
$middleware->web(append: [PortfolioUserSessionHandler::class]);
with this trick I have the logged in user in the caller project after redirect, but as a commenter said, this solution force session regenerate on every request, what is true, and not good.
If I add the StartSession::class to the web middleware, where originally exists, then again not works.
Any idea what should be the problem, the two Laravel versions use the session in different way, or.. ?
(source: https://dev.to/abdulwahidkahar/how-to-fix-session-store-not-set-on-request-laravel-11-2d4p)
Please or to participate in this conversation.