create cookies in c#

How to create cookies using c#

        /// <summary>
        ///  This method is use to create cookies using c#
        /// </summary>
        private static void CreatApp_Cookie(Session session)
            HttpCookie httpCookie = HttpContext.Current.Request.Cookies["myCookie"] ?? new HttpCookie("myCookie");
            httpCookie .Values["ID"] = Convert.ToString(session.ID);
            httpCookie .Values["Email"] = session.Email;
            httpCookie .Values["Name"] = session.Name;

            httpCookie .Expires = DateTime.Now.AddDays(365);


Hey! I'm Anil Singh. I author this blog. I'm Active Blogger, Programmer. I love learning new technologies, programming, blogging and participating the forum discussions more...
My Blogs - and
My Books - Interview Questions and Answers Books- Get Your Book in 15+ Digital Stores Worldwide..

You Might Also Like Powered by Blogger.
ASK Questions