简体   繁体   中英

session.cookie_domain not working on all browsers

The following code sets the session cookie as follow:

ini_set( 'session.cookie_domain', 'mysite.com' );
  • FF header - domain=.mysite.com
  • IE header - domain=mysite.com (no initial dot)
  • Cr header - domain=.mysite.com

The following code sets the session cookie as follow:

ini_set( 'session.cookie_domain', 'dev.mysite.com' );
  • FF - domain=.dev.mysite.com (works)
  • IE - domain=mysite.com (ignores subdomain; uses root domain, no initial dot)
  • Cr - failed to create session

Trying to set the Session cookie to a particular subdomain, so that sub1.dev.mysite.com, sub2.dev.mysite.com could access the same Session cookie. But, it only works with FF.


Set session name to something like SESS_NAME.

Interesting, I found that Chrome does not like underscore. SESS_NAME vs SESSNAME.

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