We fixed a problem with which the browser was unable to enter the subdomains by adding the following line of code.
ini_set('session.cookie_domain', '.'.get_domain('http://'.$_SERVER['SERVER_NAME']));
The get_domain function gets the domain of the site, so "sub.sub.domain.com" will return "domain.com". We will add a ".". so our sessions are good in all subdomains.
This fixed the problem of the impossibility of logging in, but the problem is that since we added this line of code, we will not accidentally log into the system, because the sessions are not created and just NULL.
I speak randomly because I cannot understand what causes it. Once a user can log in, they will try to log in the next day, and this will not work. Clearing cookies usually solves the problem. Any idea what I can do wrong? I tried a search on Google, but did not find anything that helped, our users are upset, and my ideas are running out. Any help really appreciated.
source
share