php - How to change the PHPSESSID cookie domain? -
i have 2 subdomains sub1.domain.com , sub2.domain.com
sub1 1 set login session session not shared because have different cookie domain
sub1's cookie domain => .sub1.domain.com sub2's cookie domain => .sub2.domain.com
option 1: change sub2's .sub2.domain.com
.sub1.domain.com
can share session
option 2: change sub1's .sub1.domain.com
.domain.com
i want option 1 because we're trying avoid changes on sub1.domain.com , domain.com possible.
i have tried codes on sub2's end no luck
ini_set('session.cookie_domain', '.sub1.domain.com'); session_set_cookie_params (0,'/','.sub1.domain.com');
you cannot set session.cookie_domain
different subdomain, can set .domain.com
, visible on subdomains:
ini_set('session.cookie_domain', '.domain.com');
Comments
Post a Comment