Cookies Cambridge IGCSE Computer Science revision
Not started
Learn it
In plain words
A web server has no memory of you between one request and the next. A cookie is the note it leaves on your device to recognise you: a small piece of data, sent by the web server, stored by your browser, and sent back each time you return.
4 things to know
- A cookie is a small file of data that a web server sends to a browser, which stores it on the user's device.
- A session cookie is temporary. It is deleted when the browser is closed.
- A persistent cookie is stored on the device until it reaches its expiry date or the user deletes it.
- Cookies are used for saving personal details, tracking user preferences, holding items in an online shopping cart and storing login details.
Worked example
A shopper adds two items to an online basket, closes the browser by accident, and finds the basket empty on return. The site still greets her by name. Which kinds of cookie are in use?
- The basket was lost when the browser closed, so it was held in a session cookie.
- The name was remembered after the browser closed, so it is stored in a persistent cookie.
Tips and tricks
- Session: gone when the browser closes. Persistent: stays until it expires or is deleted. That difference is the whole question.
- A cookie is data, not a program. It cannot run and it is not a virus.
It lands in your notebook with its questions as flashcards.
Cookies: 5 questions and answers
These are the quiz’s questions. Do the quiz first, then come back here for the ones that got you.
What is a cookie?
It lets a website recognise a returning user.
What happens to a session cookie when the browser is closed?
Session cookies are temporary.
Which cookie would keep you logged in to a site for a month?
It is stored until its expiry date.
Which of these is a use of cookies?
The others have nothing to do with cookies.
Where is a persistent cookie stored?
The browser stores it and sends it back on each visit.
Quiz
5 questions
Tap an answer and you’ll see straight away whether it’s right, and why.
Worksheet
2 questions, 5 marks. Write your answers on paper, then check them.
Cookies
Cambridge IGCSE Computer Science 0478 · 5 marks · papermunch.org
Name ______________________________ Date ______________
Describe the difference between a session cookie and a persistent cookie.[2]
Show answerHide answer
A session cookie is deleted when the browser is closed. A persistent cookie stays on the user's device until it expires or is deleted.
Give three uses of cookies.[3]
Show answerHide answer
Storing login details. Holding the items in an online shopping cart. Tracking the user's preferences. (Also: saving personal details.)
Answers: Cookies
- 1. A session cookie is deleted when the browser is closed. A persistent cookie stays on the user's device until it expires or is deleted.
- 2. Storing login details. Holding the items in an online shopping cart. Tracking the user's preferences. (Also: saving personal details.)



