kaushik kaushik - 1 year ago 126
ASP.NET (C#) Question

How To read cookie which created from client side javascript in serverside asp.net code

For Example I have put one cookie on page load with some specific value on button submit at server side c# code how do i get the value of that cookie ?(asp.net)

Answer Source

Reading Cookie:

if (Request.Cookies["NameofCookie"] != null)
    string value = string.Empty;
    if (Request.Cookies["NameofCookie"]["yourkey"] != null)
    { value= Request.Cookies["NameofCookie"]["yourkey"]; }
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download