HTTP and Cookies HTTP (Hypertext Transfer Protocol)is a stateless request/response protocol -Each request is independent of previous requests Advantage being stateless:servers do not need to retain information about users between requests. HTTP is stateless.Web applications are often stateful. -So the Client has to remember things that the Server needs to know. Cookie is a common way for maintaining states. -A cookie is a piece of information that contains the state(or session ID)of a client.A cookie consists of one or more name-value pairs. Server:uses Set-Cookie parameters to ask client's browser to store a cookie. Client:stores the cookie and sends the unchanged cookie in EVERY request to the same server. 55 HTTP and Cookies HTTP (Hypertext Transfer Protocol) is a stateless request/response protocol ─ Each request is independent of previous requests Advantage being stateless: servers do not need to retain information about users between requests. HTTP is stateless. Web applications are often stateful. ─ So the Client has to remember things that the Server needs to know. Cookie is a common way for maintaining states. ─ A cookie is a piece of information that contains the state (or session ID) of a client. A cookie consists of one or more name-value pairs. Server: uses Set-Cookie parameters to ask client’s browser to store a cookie. Client: stores the cookie and sends the unchanged cookie in EVERY request to the same server