cookies wont create

  • Thread starter Thread starter Aah
  • Start date Start date
A

Aah

here is my code which is use to create a cookie
for some reason when I use the domain property I am not able to see the
cookie in my cookies folder.
But when I comment out my domain property, I can see my cookie in my cookies
folder.
How can I use the domain property to create a cookie????

Dim MyCookie As New HttpCookie("firstcookie")

Dim now As DateTime = DateTime.Now

MyCookie.Domain = "hello.net"

MyCookie.Value = now.ToString()

MyCookie.Expires = now.AddHours(1)

Response.Cookies.Add(MyCookie)
 
I don't think you can use the domain property. You can use the path
property. The domain is set by the browser. You can used the domain property
when sending cookies using WebRequest.
 
my problem is I have a website www.abc.com
I am having a link of my website on test.abc.com
now whenever a visitor comes from test.abc.com , it sets a cookie under
test.abc.com
but if that cookie is set, what happens when my visitor wants to view pages
from www.abc.com
do I have to set the cookie again for www.abc.com????
if not how will make sure that the visitor does not have any problem???
 
I think you can do that, but the domain name must start with a dot try using
".abc.com". You can't change to someone elses domain. I didn't try it but it
might work.
 
Back
Top