Cookies in ASP.Net

Cookies can also be set in ASP.NET , to set cookies in asp.net you can proceed as follows

    public string GetCookies()
    {
        string myLocation = Request.Cookies[“WHLocation”].Value;
        return myLocation;
    }


    public void SetCookies(string WHLocation)
    {


        HttpCookie WHCookie = new HttpCookie(“WHCookie”);
        WHCookie.Values.Add(“WHLocation”, WHLocation);
        WHCookie.Expires= DateTime.Now.AddDays(1);


        Response.Cookies.Add(WHCookie);


    }