I've faced a strange issue with session across subdomain only for google chrome. I have two subdomain a.mydomain.com & b.mydomain.com. if I open a.mydomain.com first on browser & then open b.mydomain.com & login from there then I'm not getting the session in a.mydomain.com. But if I login first from b.mydomain.co & then open a.mydomain.com I'm getting the session in a.mydomain.com.
I'm unable to solve this. Please help
Look at the session cookies in your browser. What are the domain settings on them? Possibly your sites have different cookie settings. where the
a
site is setting a.mydomain.com
cookie, and theb
site is settingb.mydomain.com
, prevent the cookie from appear on sitea
.silly me, found the answer so liked to share it
I used session.cookie_domain only for b.mydomain.com & not for a.mydomain.com
Cookies will only be inherited when setting them on the domain one level above. Setting the cookie on example.com will inherit it to www.example.com, foo.example.com, etc. Setting a cookie on www.example.com will not show the cookie to foo.example.com.