Laravel, the subclass controller can use the session, and the parent class controller cannot use the

Source: Internet
Author: User
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.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.