5

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.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Basit
  • 16,316
  • 31
  • 93
  • 154

1 Answers1

4

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.

Community
  • 1
  • 1
Pekka
  • 442,112
  • 142
  • 972
  • 1,088
  • thank you... do you know how can i find sub-domain in url and re-write the rule, its best if i get subdomians and put that in end or url with &username=subdomain.. can you help me on this. – Basit Dec 22 '09 at 09:02
  • That's possible to do. Open a new question and add `mod_rewrite` as a tag, somebody will be able to help along. – Pekka Dec 22 '09 at 09:42