简体   繁体   中英

PHP sessions sharing - subdomain as entry point

I have a landing page like:

subdomain.mydomain.com

and there I assigned a few session vars, but now the problem is in one point user is redirected to mydomian.com and all session vars are lost.

I have tried ini_set('session.cookie_domain', '.mydomain.com' ); and htaccess and php.ini fixes, but NOTHING works.... and NO ERROR is generated, so I am kind of puzzled what's going on ?

Try to append this code, every domain, before starting session

session_name("WebsiteID");

replace WebsiteID with your favorite value.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM