Pradeep
How to create and remove that cookies in asp.net?
By Pradeep in ASP.NET on Sep 03 2009
  • Sapna Malik
    Sep, 2009 7

    This is the syntax for creating a cookies.
    HttpCookie SiteCookies = new HttpCookie("UserInfo");
    SiteCookies["UserName"] = "Pradeep";
    SiteCookies["sitename"] = "dotnetRed";
    SiteCookies["Expire"] = "5 Days";
    SiteCookies= DateTime.Now.AddDays(5);
    Response.Cookies.Add(SiteCookies);
    Now syntax to remove this cookie:-
    HttpCookie SiteCookies= new HttpCookie("UserInfo");
    siteCookies= DateTime.Now.A
    ddDays(-1);
    Response.Cookies.AddSiteCookies

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS