asp.net 2 @ client coockies

G

Guest

i am trying to use this code:
Code:
 If (True = Request.Browser.Cookies) Then ' this works!
Dim testCookie As New HttpCookie("LastVisited")
            testCookie.Values.Add("time is now", DateTime.Now.ToString)
            testCookie.Expires = DateTime.Now.AddDays(20)
            testCookie.Domain = "localhost"
            Response.AppendCookie(testCookie)
end if
to save a coockie on a localhost and it isnt working.
what am i doing wrong?
what if i put the prject on a temp server can i then write a coockie even if
i dont have a domain?
under which name will i see it in the Temporary Internet Files folder?
and should i use the above code for a new coockie and for an existing coocike?
or shouldi use somme diffrent code?

thnaks in advance
peleg
 
G

Guest

I'd set the path property to "/" and leave off the localhost "domain". See if
that helps.
Peter
 
G

Guest

thnaks alot the path did it!

Peter Bromberg said:
I'd set the path property to "/" and leave off the localhost "domain". See if
that helps.
Peter
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com



pelegk1 said:
i am trying to use this code:
Code:
If (True = Request.Browser.Cookies) Then ' this works!
Dim testCookie As New HttpCookie("LastVisited")
testCookie.Values.Add("time is now", DateTime.Now.ToString)
testCookie.Expires = DateTime.Now.AddDays(20)
testCookie.Domain = "localhost"
Response.AppendCookie(testCookie)
end if
to save a coockie on a localhost and it isnt working.
what am i doing wrong?
what if i put the prject on a temp server can i then write a coockie even if
i dont have a domain?
under which name will i see it in the Temporary Internet Files folder?
and should i use the above code for a new coockie and for an existing coocike?
or shouldi use somme diffrent code?

thnaks in advance
peleg
 
G

Guest

first thnaks alot
but if say i dont work on localhost but on ip with no domain yet,shold i do
the same?

Peter Bromberg said:
I'd set the path property to "/" and leave off the localhost "domain". See if
that helps.
Peter
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com



pelegk1 said:
i am trying to use this code:
Code:
If (True = Request.Browser.Cookies) Then ' this works!
Dim testCookie As New HttpCookie("LastVisited")
testCookie.Values.Add("time is now", DateTime.Now.ToString)
testCookie.Expires = DateTime.Now.AddDays(20)
testCookie.Domain = "localhost"
Response.AppendCookie(testCookie)
end if
to save a coockie on a localhost and it isnt working.
what am i doing wrong?
what if i put the prject on a temp server can i then write a coockie even if
i dont have a domain?
under which name will i see it in the Temporary Internet Files folder?
and should i use the above code for a new coockie and for an existing coocike?
or shouldi use somme diffrent code?

thnaks in advance
peleg
 
J

Juan T. Llibre

re:
!> if say i dont work on localhost but on ip with no domain yet,shold i do the same?

Yes. Setting the path to "/" will do it for you.





pelegk1 said:
first thnaks alot
but if say i dont work on localhost but on ip with no domain yet,shold i do
the same?

Peter Bromberg said:
I'd set the path property to "/" and leave off the localhost "domain". See if
that helps.
Peter
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com



pelegk1 said:
i am trying to use this code:
Code:
If (True = Request.Browser.Cookies) Then ' this works!
Dim testCookie As New HttpCookie("LastVisited")
testCookie.Values.Add("time is now", DateTime.Now.ToString)
testCookie.Expires = DateTime.Now.AddDays(20)
testCookie.Domain = "localhost"
Response.AppendCookie(testCookie)
end if
to save a coockie on a localhost and it isnt working.
what am i doing wrong?
what if i put the prject on a temp server can i then write a coockie even if
i dont have a domain?
under which name will i see it in the Temporary Internet Files folder?
and should i use the above code for a new coockie and for an existing coocike?
or shouldi use somme diffrent code?

thnaks in advance
peleg
 
G

Guest

great thnaks alot!

Juan T. Llibre said:
re:
!> if say i dont work on localhost but on ip with no domain yet,shold i do the same?

Yes. Setting the path to "/" will do it for you.





pelegk1 said:
first thnaks alot
but if say i dont work on localhost but on ip with no domain yet,shold i do
the same?

Peter Bromberg said:
I'd set the path property to "/" and leave off the localhost "domain". See if
that helps.
Peter
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com



:

i am trying to use this code:
Code:
If (True = Request.Browser.Cookies) Then ' this works!
Dim testCookie As New HttpCookie("LastVisited")
testCookie.Values.Add("time is now", DateTime.Now.ToString)
testCookie.Expires = DateTime.Now.AddDays(20)
testCookie.Domain = "localhost"
Response.AppendCookie(testCookie)
end if
to save a coockie on a localhost and it isnt working.
what am i doing wrong?
what if i put the prject on a temp server can i then write a coockie even if
i dont have a domain?
under which name will i see it in the Temporary Internet Files folder?
and should i use the above code for a new coockie and for an existing coocike?
or shouldi use somme diffrent code?

thnaks in advance
peleg
 

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

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,278
Latest member
BuzzDefenderpro

Latest Threads

Top