I have an ASP file called testcookie.asp that contents this small script:
response.cookies ("MyCookie")("MyValue") = 99
response.cookies ("MyCookie").expires = DATE + 1
I also has an ASP file to write the cookie. It's called writecookie.asp.
Here what I put on that file.
Then, I run test cookie file (http://myURL.com/testcookie.asp
). I didn't use www in front of the domain name.
When I run the write cookie file without typing www on front of the domain (http://myURL.com/writecookie.asp
), it does not display the value of the cookie.
However, if I put "www", it works properly.
I also tried to run the test file by putting "www" in front of my domain name. Then, running the write file, and it works properly.
When I checked the cookies on the "cookies" folder, the script create two cookies files, one if for the file that I ran using "www", and the other one is for the one without "www".
Is there any way that make my cookie work in both, so I can still detect the same cookie whether the user is typing the URL with our without "www".