Laravel, the subclass controller can use the session, the parent class controller cannot be used. How should we solve it?
Reply content:
Laravel, the subclass controller can use the session, the parent class controller cannot be used. How should we solve it?
Considering the situation you're describing, it's not very detailed.
Check if the session is set path, config/session.php
the path needs to be /
, or another path, cannot be an empty string
Laravel does bug,laravel under the session. If you use file as the engine of the session, when you request some pages at the same time, it does appear that the SessionID is not acquired and is reset (Set-cookie: SESSIONID=XXXX), the session engine is changed to database, Redis, can be resolved, (need php artisan session:table
and migration of the database)
(. Env SESSION_DRIVE
)
The problem is described in more detail, Laravel session and controller have no relationship.