Simulate session cookies in mobile sessions?

前端 未结 5 1768
清歌不尽
清歌不尽 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:16

    My solution to a similar problem was to use the document.referrer in combination with the cookie. If the user is navigating around within your site then keep using the cookie if it exists, otherwise expire or replace the cookie.

    The problem is still there for when the user puts the browser in the background while on your site though. If they resume browsing and just use a link in your site, the cookie will still be used.

提交回复
热议问题