ie complicated subdomain cookie problem

2019-04-08 14:46发布

all my cookies work great on subdomain, but if subdomain has "_" in it, then cookie dont get read at all and dont get right at all eaither. following are my tested result, which will self explain

justlife.demo.com        *** works fine ***
just-life.demo.com       *** works fine ***
just-.demo.com           *** works fine ***

just_.demo.com           *** DONT works fine ***
just_life.demo.com       *** DONT works fine ***

domain that dont work, the cookies for them shows completely emtpy and you cant write or read from that sub-domains..

this problem is only in IE.

firefox and chrome works fine, they dont have this error.

any solutions? these subdomains are usernames.

1条回答
迷人小祖宗
2楼-- · 2019-04-08 15:13

IE has problems with underscores in sub domain namens. See the question here.

From there:

MSIE 7, on a domain with an underscore, silently drops all cookies for that host and refuses to accept new ones.

only solution is to use RFC-compliant domains (I've replaced all the "_"s with "-"s and set up a RewriteRule so that traffic is redirected to the compliant domains).

I'm afraid you are going to have to drop the underscore domains, or work around your cookie problem.

查看更多
登录 后发表回答