HttpCookie myCookie = new HttpCookie("MyTestCookie");
myCookie.Expires = now.AddMinutes(1);//cookie在一分钟以后失效。

解决方案 »

  1.   

    这个我知道.
    我的意思是我在网页上设置一个注销按钮.
    如果他点这个接钮.
    COOKIE马上消失.
    他恢复到登录之前的样子.
    类似于SESSION.ABANON
      

  2.   

    注销按钮? is it a client side button or server button? if it is a server button, use  gshope(北京.Net) 's methodif it is a client button, see the DeleteCookie method here:<SCRIPT>
    // Delete the cookie with the specified name.
    function DelCookie(sName)
    {
      document.cookie = sName + "=" + escape(sValue) + "; expires=Fri, 31 Dec 1999 23:59:59 GMT;";
    }
    </SCRIPT>
    http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/properties/cookie.asp
      

  3.   

    Response.Cookies.Remove("youcookie");
    快快给分啊