Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1Set-Cookie: lang=fr; Max-Age=15552000 | AThe cart is only needed during one visit, so it should be a session cookie. A persistent cookie that lasts 5 years is not needed and stores data for far too long. | |
| 2Set-Cookie: cart=Item42 | Bcookie_type = "persistent" # language, months | |
| 3On a shared school computer, a bank login should use a session cookie because it is deleted when the browser closes and the next user cannot get in. | CA session cookie: it has no expiry time, so it is deleted when the browser is closed. | |
| 4A website that remembers your language choice for months needs a persistent cookie because the setting must still be there on your next visit. | DA persistent cookie stays on a shared computer after the browser closes, so the next person could use the account. A session cookie is the safe choice. | |
| 5Bank login on a library PC: use a persistent cookie because it is quicker next time. | Ecookie_type = "session" # bank login, shared PC | |
| 6One-visit shopping cart: use a persistent cookie for 5 years. | FA persistent cookie: it lasts about 6 months, so the language setting is remembered on later visits. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
session or persistent — Decide how long a cookie must last: session if it can go when the browser closes, persistent if it must last for later visits. Justify your choice with because.SCENARIO ← "bank login, shared computer"
COOKIE ← "session"SCENARIO ← "language setting for months"
COOKIE ← "persistent"SCENARIO ← "one-visit shopping cart"
COOKIE ← "session"IF NeededLater THEN
COOKIE ← "persistent"
ELSE COOKIE ← "session"Session because the cart is not needed later