How to delete cookies on an ASP.NET website

后端 未结 11 2072
傲寒
傲寒 2020-11-30 05:07

In my website when the user clicks on the \"Logout\" button, the Logout.aspx page loads with code Session.Clear().

In ASP.NET/C#, does this clear all co

11条回答
  •  北海茫月
    2020-11-30 05:47

    You should never store password as a cookie. To delete a cookie, you really just need to modify and expire it. You can't really delete it, ie, remove it from the user's disk.

    Here is a sample:

    HttpCookie aCookie;
        string cookieName;
        int limit = Request.Cookies.Count;
        for (int i=0; i

提交回复
热议问题