ASP.net Session Destroy if he closes the browser

前端 未结 8 1097
孤独总比滥情好
孤独总比滥情好 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:16

    Page.Unload() isn't called when the user leaves the site, it's called when the engine is finished rendering it, right before HTML is sent to the browser. There is no access to the page through once that's happened.

    I know in PHP you can use AJAX to call a PHP function with javascript. I don't know if this is possible with ASP.Net, or will work for sessions.

提交回复
热议问题