Get Cookie - CSharp System.Web

CSharp examples for System.Web:Cookie

Description

Get Cookie

Demo Code


using System.Web;
using System.Text;
using System.Net;
using System.Linq;
using System.Configuration;
using System.Collections.Generic;
using System;// ww  w . jav a  2  s.  c om

public class Main{

        public static HttpCookie GetCookie(string cookieName)
        {
            HttpRequest request = HttpContext.Current.Request;
            if (request != null)
                return request.Cookies[cookieName];
            return null;
        }
}

Related Tutorials