When client request to the server, server send the cookies into client . The same cookies can be referred for subsequent request. As for example, if codeproject.com stores session id as a cookies, when any client hits first times on the server, server generates the session id and send it as a cookies to client. [As given in Fig 1.0]

Fig 1.0 : Initial state of cookie creation
Now for all other subsequent from the same client it uses the session-id from cookies, just like the picture below:
Fig 1.1 : Subsequent request for other pages
Browser and web server are responsible for exchange cookies information. For different sites, browser keeps cookies differently. If any pages need information from cookies, when that URL is being hit, first its search for local system for cookies information then its moved to server with that information.

No comments:
Post a Comment