Laravel maintain a Session in subdomain of different server

前端 未结 1 1340
生来不讨喜
生来不讨喜 2020-12-16 21:23

Suppose in a domain (app.domain.com) I have set a Session like this:

Session::put(\'test\', \'value\');

Then in different doma

相关标签:
1条回答
  • 2020-12-16 21:28

    If you have the subdomains hosted on different physical machines, setting the domain in app/config/session.php to this:

    'domain' => '.domain.com'
    

    will work as long as the two apps will be able to access a shared session data storage (for example using the database session driver and having a common database that stores the sessions).

    0 讨论(0)
提交回复
热议问题