What happens to a session cookie (one without Max-Age or Expires) when the browser is closed?
- A.The browser never deletes session cookies at close (they are kept in the profile folder), leaving them for the next visit to the site
- B.Session cookies are deleted when the tab closes (each tab has its own jar), with the other tabs keeping all of theirs in use
- C.The browser sends session cookies to the server once more at close (a final request), then deletes all of them from the jar
- D.The browser deletes session cookies when the browser session ends (all windows closed), making them ephemeral
Why D is correct
Session cookies - those without Expires or Max-Age - are stored only in memory and deleted when the browser session ends (all windows/tabs of the browser are closed). This is a convenient security feature for shared computers. Note: modern browsers with session restore can persist session cookies across restarts if the user has 'restore previous session' enabled.
Know someone studying for Web App Fundamentals? Send them this one.