How to create a cookie in ASP.NET

Total Post:12


 2461  View(s)
Rate this:
I am new in development please guide me to create cookie in ASP.NET
  1. Re: How to create a cookie in ASP.NET

    Check this article anoop..

    // Add this on the beginning of your .cs code file
    using System;
    // Use this line when you want to save a cookie
    Response.Cookies["CookieName"].Value ="CookieValue";
    // How long will cookie exist on client hard disk
    Response.Cookies["CookieName"].Expires = DateTime.Now.AddDays(2);

    // To add multiple key/value pairs in single cookie
    Response.Cookies["EmployeeData"]["FirstName"] = "Mark";
    Response.Cookies["EmployeeData"]["LastVisit"] = DateTime.Now.ToString();

  1. Re: How to create a cookie in ASP.NET

    For more concept...

    Click Here



Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.