ASP.net Session Destroy if he closes the browser

前端 未结 8 1101
孤独总比滥情好
孤独总比滥情好 2021-01-17 03:34

I have an website. When the user is logged the session details will loaded. When the user logged out the session details will abandoned. (Log out by clicking the logout menu

8条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-17 04:20

    You have basically two options:

    • Set time-out of your session cookies for 1 minute and send "keep-alive" AJAX request every 30 seconds.
    • Don't use cookies, just pass session parameters in query.

    Each solution will work on 99%, if you combine them, you should be pretty much set on 99.99% of cases. Depends how important this behavior is to you.

提交回复
热议问题