I am trying to use Laravel on a host that has many subdomains. Only one subdomain will have a Laravel application, but I would like to share some things (for example, with the current user) through my own PHP session.
I edited the Laravel session configuration to work with subdomains by changing the domain value:
'cookie' => 'mydomain_session', 'domain' => '.mydomain.com',
In another subdomain where Laravel is not working, I try to access the session as follows:
session_name("mydomain_session"); session_set_cookie_params(0,'/','.mydomain.com',false,true); session_start();
but it does not work, if I try to repeat the variable $ _SESSION, it will be empty.
The strangest thing is that if I try to repeat session_id (), it will be the same in both subdomains.
Moreover, if I install the same script in the third subdomain, it will not be a problem in conjunction with a session with another non-laurel subdomain.
So what am I doing wrong? Am I missing something, or is Laravel not managing my own PHP session in the usual way?
Any help is appreciated!
Ingro source share