Suppose in a domain (app.domain.com
) I have set a Session like this:
Session::put('test', 'value');
Then in different domain (ex. news.domain.com
) I want to retrieve that session value. Note that the other domain is located ON DIFFERENT SERVER, but still same domain name.
My question is, will Session::get('test')
is available in news.domain.com
if I set the laravel config file to domain => '*.domain.com'
?
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With