if (Request.Cookies["x"] != null && Convert.ToDateTime(Request.Cookies["x"].Expires) < DateTime.Now)
{
}
else
{
ModalPopupExtender1.Show();
Response.Cookies["x"].Value = DateTime.Now.ToString();
Response.Cookies["x"].Expires = DateTime.Now.AddHours(24);
}
This works.