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

AI LearningWeb Platform

Coursify — Personal AI Course Generator

Struggling with a difficult subject or concept? Turn any engineering topic into a structured course with interactive lessons, quizzes, and research-backed explanations.