CSharp examples for System.Web:Cookie
Get item value from Cookie
using System.Web; using System.Text; using System.Linq; using System.Collections.Generic; using System;// w ww . j a v a2s . co m public class Main{ public static string Get(string cookieKey,string itemKey) { string value = string.Empty; HttpCookie cookie = HttpContext.Current.Request.Cookies[cookieKey]; if (cookie != null) { value = cookie.Values[itemKey]; } return value; } public static string Get(string cookieKey) { HttpCookie cookie = HttpContext.Current.Request.Cookies[cookieKey]; if (cookie != null) return cookie.Value; return ""; } }