Simulate session cookies in mobile sessions?

前端 未结 5 1766
清歌不尽
清歌不尽 2020-12-31 04:42

I discovered to my astonishment at the first glance that my thinking of how session cookies behave on mobile devices is overruled by reality.

On normal desktop brows

5条回答
  •  旧巷少年郎
    2020-12-31 05:10

    I would ask the user if wants to remember the location. If not set cookies' expiration to servers' timeout. You will give user a choice to pick user experience.

    You can try attach to onbeforeunload event and make a post to server to alter cookies' expiration time or if cookie is not secure type then delete it from java script.

提交回复
热议问题