asp.net 2 @ client coockies

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
I'd set the path property to "/" and leave off the localhost "domain". See if
that helps.
Peter
 
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
 
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
 
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.




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
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
 
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.




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
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

Back
Top