शब्दकोश · इंटरनेट और वेब

Cookie (HTTP Cookie)

A cookie is a small piece of data a website stores in your browser and sends back with later requests, used for sessions, preferences and tracking.

अपडेट: अक्टूबर 6, 2026

A cookie is a small name-value pair that a server sets in a browser using the Set-Cookie header. The browser sends it back with each matching request, letting the site recognize a returning visitor.

Why it matters

Because HTTP is stateless, cookies are how sites keep you logged in, remember a cart or store a language choice. They are also used for analytics and advertising, which is why privacy laws and consent banners focus on them. Their attributes decide whether they are safe.

Many regions require informing visitors and, for non-essential cookies, obtaining consent first, so know which cookies your site sets and why.

Example

Set-Cookie: session_id=abc123; Path=/; Secure; HttpOnly; SameSite=Lax; Max-Age=3600

Secure restricts it to HTTPS, HttpOnly hides it from JavaScript, and SameSite limits cross-site sending.

Common mistakes

  • Omitting Secure and HttpOnly on session cookies.
  • Storing sensitive data directly in a cookie instead of a server-side session.
  • Setting cookies on a broad domain so every subdomain receives them unnecessarily.

Get notified when this term updates

Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.

यह पेज सामान्य जानकारी है, जिसे हमारी संपादकीय टीम ने लिखा है और दस्तावेज़ीकरण बदलने पर अपडेट किया जाता है। सर्वर और प्रदाता अलग-अलग होते हैं, इसलिए बदलाव पहले सुरक्षित तरीके से जाँचें। देखें: संपादकीय नीति और अस्वीकरण.