C# Cookie SITESERVER Problem

J

Jimmy

Problem:
My cookie name is supposed to be "MyCookie123whatever..." but when I
take a look at my cookies, it's called "SITESERVER" and it's not
keeping any of the properties (expiration, etc..) that I've set in the
codebehind.

Code:
HttpCookie myCookie = Request.Cookies["MyCookie"];

//check to see if it exists
if (myCookie == null)
{
//build the cookie
HttpCookie newCookie = new HttpCookie("MyCookie");
newCookie.Expires = DateTime.Now.AddDays(7.0);
//add the cookie
Response.Cookies.Add(newCookie);
}
else
{
Response.Write("cookie exists");
}

Please help...
 

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,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top