Which one of the following allows the session to continue?
2022
Which one of the following allows the session to continue?
- A.
When a user quits a browser
- B.
When the user logs out and is invalidated by the servlet
- C.
When the session is timed out due to inactivity
- D.
When the user refreshes the browser and there is a persistent cookie
Attempted by 292 students.
Show answer & explanation
Correct answer: D
A web session relies on the client (browser) identifying itself to the server, usually via a session ID stored in a cookie. When a user refreshes the browser, the browser re-sends this cookie to the server, allowing the server to recognize the user and keep the session active. In contrast, logging out (Option B) and timing out (Option C) explicitly terminate the session on the server side, while quitting the browser (Option A) typically clears non-persistent session cookies, effectively ending the active session. Therefore, only Option D describes a scenario where the session logic remains valid and continuous.
A video solution is available for this question — log in and enroll to watch it.