title: Cookie expiration issue in asp.net
body: <p>I am creating a cookie and getting a textbox value in it.I need to expire it and then has to print a message by checking that it has been expired or not.I am doing as following</p>
  
  <pre><code> HttpCookie usercookie = new HttpCookie("userinfo");
          Response.Cookies["gettingusername"].Value = textbox_username.Text;
          Response.Cookies["gettingusername"].Expires = DateTime.Now;
          Response.Cookies.Add(usercookie);
          if (Request.Cookies["gettingusername"]!=null)
          {
              Response.Write("Cookie is Not Expired");
          }
          else
          {
             Response.Write("Cookie Expired");
          }
  </code></pre>
  
  <p>But it always says:-</p>
  
  <pre><code>Cookie is Not Expired  
  </code></pre>
  
  <p>I am newbie for it.Please help.
  Thanks in advance.</p>