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.comwww.prenia.comWeblog: blogs.prenia.com/cathi