Learn in your language
Skip to content
IGCSE · Cambridge (CIE) · 0478

Explain session and persistent cookies

Describe what cookies store, common uses, and how session and persistent cookies differ.

Cambridge IGCSE Computer Science 0478 · The internet and its uses · 2026–2028 Version 6 · 5.1

This sequence follows Cambridge IGCSE Computer Science 0478, 2026–2028 syllabus Version 6. It covers subject content sections 5.1–5.3 only. The separately published 2029–2031 syllabus is not mapped here. Practice is original, self-checked and does not award an official Cambridge grade. Full timed papers and human subject-teacher review remain outstanding.

Before you begin

  • No programming language is required. Be comfortable with place value and multiplication; each lesson introduces the computer-science notation it uses.

Work on paper. Try each question before revealing help, and explain why your method works.

Quick readiness check

What does a cookie store?

What you will learn

  • Define a cookie
  • Compare session and persistent cookies
  • Explain common cookie uses and privacy choices

Cookies store data used by a website

A cookie is small data stored by a browser for a website. It can help save personal details, track preferences, keep items in a shopping cart or support a sign-in session. A cookie is not the whole web page or a program that automatically infects the device.

Apply and check the rule

A session cookie is usually removed when the browser session ends. A persistent cookie is stored with an expiry or duration and can remain for later visits. Cookies can improve convenience, but users should review privacy settings and avoid storing sensitive information carelessly.

Pause and explain

A cart disappears when the browser is closed. Which cookie type may have been used?

Put the idea to work

Worked example

A shop keeps a cart while a tab is open and remembers a language preference next month. Which cookie type may suit each?

Show the worked solution
  1. A short-lived cart can use a session cookie.
  2. A preference retained across visits needs a persistent cookie.
  3. The user can change cookie settings to manage tracking.

Answer Session cookie for the current visit; persistent cookie for the saved preference.

Try a topic test

Choose Easy, Normal or Difficult. Save your answers and open worked review after finishing.

Test this topic →

From guided practice to a new situation

Write your answer and reasoning first. Use a hint only if you are stuck. The model solution is for self-checking; your written work is not automatically marked.

1 · Guided

State one use of a cookie for an online shop and one use for a returning learner.

Give me a hint

Think about retaining temporary choices.

Compare my reasoning
  1. The shop can keep shopping-cart items.
  2. A learning site can remember preferences or a sign-in session.
  3. Both are small website-related data stored by the browser.

A cookie may keep cart items and may remember a learner's preferences or sign-in session.

Look for these in your work

  • Two relevant uses
  • Browser storage stated
2 · Independent

Classify a cookie that expires when the browser closes and one that remembers a preference for a month.

Give me a hint

Compare how long each item remains stored.

Compare my reasoning
  1. The first is tied to the current session.
  2. The second has a longer expiry across visits.
  3. These are session and persistent cookies respectively.

Session cookie; persistent cookie.

Look for these in your work

  • Session identified
  • Persistent identified
3 · Transfer

A website asks to store a long-term identifier for tracking preferences. Give one benefit and one privacy concern, then name a user control.

Give me a hint

Balance convenience with collection across visits.

Compare my reasoning
  1. It may keep preferences so the user need not set them again.
  2. A persistent identifier may support tracking across visits.
  3. Cookie or privacy settings can restrict or remove stored data.

The preference is convenient, but a persistent identifier may enable tracking. The user can review cookie or privacy settings and reject or remove it where available.

Look for these in your work

  • Benefit
  • Privacy risk
  • User control

Common mistakes

  • Treating all cookies as malware
  • Assuming session and persistent cookies last for the same period
Recall without your notes

What can you explain now?

Which cookie can remain after the browser session ends?

Compare with the explanation

Persistent cookie

It has a set expiry or duration that can span multiple visits.

After trying it yourself, choose your next review. This is your self-assessment.

Your review choice appears on Today. Sign in to sync it across devices.

Make it stick

What is the difference between a session cookie and a persistent cookie?

If you needed the solution, close it and solve the problem again from a blank page. A correct answer is stronger when you can explain the reason for each step.

Keep learning Computer Science

Course scope and assessment

165 original lessons map the listed objectives across all 10 main topics in the 2026–2028 Version 6 syllabus, with worked explanations and guided, independent and transfer practice. This is mapped teaching coverage, not proof of full exam readiness. Three earlier starter lessons remain available but are not counted as syllabus-mapped teaching. Practical programming experience in an executable browser workspace, full timed-paper practice, human subject-teacher review and the separate 2029–2031 syllabus remain outstanding. Practice is self-checked and does not award an official Cambridge grade.

StudyForA · Learn with understanding

Original teaching content and links to official sources. Check your exam year and qualification before using a resource.