cookies wont create

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)
 
V

vMike

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.
 
A

Aah

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???
 
V

vMike

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,163
Latest member
Sasha15427
Top