6
Reply

What exactly the term cookies refer to?

Jessica Stephen

Jessica Stephen

12y
6.2k
0
Reply

    Cookies are small text files usually having a size below 4KB stored in user's machine to keep track of the requests made to the web server.

    Hi Jassica,

    In simple words cookies are the information of all HTTP requests which you have requested to Web Server. It is stored on your own system.

    Kind Regards

    There two type of assembly in asp.net

    a. Private assembly-use for single application and reside in same directory path.
    b. Global assembly-use for multiple application and resied in GAC.

    Simply we can say,


    It is text file with the stored info in the user machine not server.
    Just storing and retrieving data from local file.

    Thus all, to say about cookie as simple.



    Cookies provide another way that you can store information for later use. Cookies are small
    files that are created on the client's hard drive. One advantage of cookies is that they work transparently without the user being
    aware that information needs to be stored. They also can be easily used by any page in your
    application and even be retained between visits, which allows for truly long-term storage.

    Cookies are also known by many names, HTTP Cookie, Web Cookie, Browser Cookie, Session Cookie, etc. Cookies are one of several ways to store data about web site visitors during the time when web server and browser are not connected. Common use of cookies is to remember users between visits. Practically, cookie is a small text file sent by web server and saved by web browser on client machine.


            Cookies may be used for authentication, identification of a user session, user's preferences, shopping cart contents, or anything else that can be accomplished through storing text data. Cookies can also be used for travelling of data from one page to another.

    set value/values to cookie

    HttpCookie StudentCookies = new HttpCookie("StudentCookies");
    StudentCookies.Value = TextBox1.Text;
    StudentCookies.Expires = DateTime.Now.AddHours(1);
    Response.Cookies.Add(StudentCookies);

    get value/values from cookie

    string roll = Request.Cookies["StudentCookies"].Value;