Computer Networks · TEE · papers
Q7(b) · HTTP state
2023-01-27 · AI-only Sem V
Exact historical variant. Current-syllabus questions solved; excluded topics and source limitations stated.
Q7(b). How do websites get around HTTP statelessness? Explain using an example. [5 marks]
Answer
| Concept | Explanation | Example |
|---|---|---|
| GET | Retrieve the selected representation | Read a page |
| POST | Ask the resource to process submitted content | Submit a form |
| PUT / DELETE | Replace target representation / request removal according to server semantics | Update/delete an API resource |
| 200 / 301 / 404 / 500 | Success / permanent redirect / not found / server error | Read status before interpreting body |
| Persistent connection | Reuse a connection for multiple exchanges | Avoid repeated TCP setup for each image |
| Cookie/session token | Carry an identifier so the application can relate requests | Remain signed in |
| HTTPS | HTTP protected by authenticated encryption through TLS in common deployments | Protect credentials and content in transit |
A secure transport protects the connection; it does not prove that every server’s content is truthful. HTTP method semantics and application authorization still matter. For exam comparisons, separate HTTP semantics, connection lifetime and application session state.
| First visit | → | Server creates customer/session ID | → | Set-Cookie header | → | Browser stores cookie | → | Later Cookie header | → | Server retrieves purchase record |
Keep the purchase record in the server database keyed by a suitable identifier; the browser need only carry that identifier. Example: cookie customer=R81 links later visits to R81’s stored orders. HTTP requests remain independent at the protocol level; the application supplies continuity. Account login can restore the record when a cookie is absent.