Laravel, the subclass controller can use session, and the parent controller cannot use session. How can this problem be solved? Laravel, the subclass controller can use session, and the parent controller cannot use session. How can this problem be solved?
Reply content:
Laravel, the subclass controller can use session, and the parent controller cannot use session. How can this problem be solved?
Considering that the information you described is not detailed
Check whether the path is set for the Session,Config/session. phpThe path of must be/, Or other paths, cannot be a null string
Laravel does have bugs in the Session. if Laravel uses file as the Session engineSimultaneous requestIn some pages, the SessionID cannot be obtained and is reset (set-cookie: sessionid = xxxx). you can change the Session engine to database or redis to solve the problem.Php artisan session: tableAnd migrate the database)
(. Env'sSESSION_DRIVE)
Let's describe the problem in detail. laravel session has nothing to do with the controller.