Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cookie creation
Message
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Divers
Thread ID:
00856027
Message ID:
00856144
Vues:
17
Thanks to everyone who tried to help. :)

OK, the problem here was the .Domain = "http://www.xyz.com" if you are not http://www.xyz.com the cookie will not persist. The following code works great. No need to set the domain.
   Dim objCookieObject As HttpCookie, objCookieObject1 As HttpCookie
   objCookieObject = New HttpCookie(strName, strValue)
   objCookieObject.Expires = Now.AddMonths(1)
   Response.Cookies.Add(objCookieObject)
<pre>
>After executing the following why would I have no cookie present in the cookies folder?
>
><pre>
>        Dim myUri As New Uri("http://www.xyz.com")
>        Dim request As HttpWebRequest = CType(WebRequest.Create(myUri), HttpWebRequest)
>        request.CookieContainer = New CookieContainer
>
>        Dim response As HttpWebResponse = CType(request.GetResponse(), HttpWebResponse)
>        Dim ckyXYZ As New Cookie
>        With ckyXYZ
>            .Comment = "This is a comment for our Cookie"
>            .Domain = "http://www.xyz.com"
>            .Expires = Now.AddMonths(1)
>            .Name = "Fred"
>            .Value = "My Cookies Value"
>        End With
>
>        response.Cookies.Add(ckyAT)
>
>
>
>???
~Joe Johnston USA

"If ye love wealth better than liberty, the tranquility of servitude better than the animated contest of freedom, go home from us in peace. We ask not your counsel or arms. Crouch down and lick the hands which feed you. May your chains set lightly upon you, and may posterity forget that ye were our countrymen."
~Samuel Adams

Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform