When does a cookie with expiration time 'At end of session' expire?

后端 未结 4 1301
情深已故
情深已故 2020-12-15 02:18

There is a session cookie with expiration time which says \'At end of session\'. When exactly does it expire or will it be alive forever?

4条回答
  •  心在旅途
    2020-12-15 02:54

    Cookies that 'expire at end of the session' expire unpredictably from the user's perspective!

    On iOS with Safari they expire whenever you switch apps!

    On Android with Chrome they don't expire when you close the browser.

    On Windows desktop running Chrome they expire when you close the browser. That's not when you close your website's tab; its when you close all tabs. Nor do they expire if there are any other browser windows open. If users run web apps as windows they might not even know they are browser windows. So your cookie's life depends on what the user is doing with some apparently unrelated app.

提交回复
热议问题