ASP.net Session Destroy if he closes the browser

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

    You can use the Page.OnUnload javascript event to make a request to a page that calls Session.Abandon(). This will cause the users session to be deleted whenever he leaves your site.

提交回复
热议问题