Thursday, October 13, 2011

Reading a Cookie (Visual C#)

uses the HttpCookie class and its properties to read a cookie with a specific name.



HttpCookie myCookie = new HttpCookie("MyTestCookie");
myCookie = Request.Cookies["MyTestCookie"];

// Read the cookie information and display it.
if (myCookie != null)
   Response.Write("<p>"+ myCookie.Name + "<p>"+ myCookie.Value);
else
   Response.Write("not found");

No comments:

Post a Comment

Thank you for Commenting Will reply soon ......

Featured Posts

list of free science and technology journals available online:

  PLOS  -  Website eScholarships  -  Website Directory of Open Access Journals (DOAJ)  -  Website International Journal for Modern Trends in...