Cookie. Urgent. Thank You.

S

Shapper

Hello,

I have a Cookie which can have one or many values.
One of this values is "Culture".

How can I change the "Culture" value which in inside the cookie?

This is what I have:
Dim cookie As HttpCookie = Request.Cookies("MyWebSite")
If Not cookie Is Nothing Then ' Cookie MyWebSite exists

??? NEED to change the existing value of culture from en-US to fr-FR

Else ' Cookie MyWebSite Does Not Exist

' Create Cookie and Add "culture" value to it.

Dim newCookie As HttpCookie = New HttpCookie("MyWebSite")
newCookie.Values.Add("culture", "en-US")
newCookie.Expires = #01/01/3000#
Response.Cookies.Add(newCookie)

End If
 
B

Brock Allen

Actually this should work:
Dim newCookie As HttpCookie = New HttpCookie("MyWebSite")
newCookie.Values.Add("culture", "en-US")
newCookie.Expires = #01/01/3000#
Response.Cookies.Add(newCookie)

Does it not for some reason?
 
J

Juan T. Llibre

If it does, it shouldn't.

Setting a cookie expiration date for the year 3,000
is wildly optimistic about the survival time for the
computer where the cookie is being stored... ;-)
 
B

Brock Allen

If it does, it shouldn't.
Setting a cookie expiration date for the year 3,000 is wildly
optimistic about the survival time for the computer where the cookie
is being stored... ;-)

LOL -- I was speaking about the mechanics. I didn't even notice the date...
*giggle*
 

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,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top