Back to the 2023 paper

Module III: Basics of Web Programming

20232m

Explain cookies.

Worked SolutionAI Assisted

A cookie is a small piece of data (name=value, up to ~4 KB) that a server sends to the browser, which stores it and returns it with every later request to the same site. It is used to make the stateless HTTP protocol remember a user.

Uses: session management (login state), personalization (theme, language), and tracking (analytics, ads).

Attributes: Expires/Max-Age, Path, Domain, Secure, HttpOnly, SameSite.

Set-Cookie: theme=dark; Max-Age=86400; Path=/; HttpOnly; Secure

Similar questions

Budget AppAndroid App

Pocketly on Android

Log daily food, travel, and hostel expenses instantly. Set monthly spending limits and see where your money goes without complex spreadsheets.