Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating cookie
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Divers
Thread ID:
00916866
Message ID:
00917398
Vues:
14
Hi Dmitry,

I tried your sample code and it worked for me just fine. I would suggest turning on Page Tracing for the page and see if you see the cookie.

>I was wondering if anybody can see what I am doing wrong in creating a
>cookie:
>
>cUserId = Guid.NewGuid().ToString().GetHashCode().ToString("x");
>
>HttpCookie oCookie2 = new HttpCookie( "MyTestCookie", cUserId );
>
>oCookie2.Expires = DateTime.Now.AddMonths(24);
>Response.Cookies.Add(oCookie2);
>
>
>Then when I check the cookie collection, I never see this "MyTestCookie".
>Here is how I check for all cookies:
>
>
>foreach ( string strKey in Request.Cookies )
>{
>Response.Write("<li>" + strKey + " = " + Request.Cookies[ strKey ].Values );
>}
>
>
>The only cookie I see in the foreach above is ASP.NET_SessionId
>
>What am I missing?
>
>Thank you.
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform