1
Reply

what is the difference between cookies & sessoins? in real time where we can use? give some examples?

sarvi koppula

sarvi koppula

14y
5.5k
0
Reply

    Reference: msdn
    A session is defined as the period of time that a unique user interacts with a Web application. Active Server Pages (ASP) developers who wish to retain data for unique user sessions can use an intrinsic feature known as session state.

    For example, a user selects stocks to track and the Web application can store these values in the user's ASP session instance:

    Session("Stocks") = "MSFT; VRSN; GE"

    ASP maintains session state by providing the client with a unique key
    assigned to the user when the session begins. This key is stored in an
    HTTP cookie that the client sends to the server on each request. The
    server can then read the key from the cookie and re-inflate the server
    session state.
    On the other hand Cookies are Client side state management

    Cookies are useful for storing small amounts of frequently changed information on the client. The information is sent with the request to the server.

    Cookies provide a means in Web applications to store user-specific information. For example, when a user visits your site, you can use cookies to store user preferences or other information. When the user visits your Web site another time, the application can retrieve the information it stored earlier. e.g your yahoo or hotmail or gmail