i want to fire an event in asp.net when my user session has been expired or i close browser. actually i want to update some thing in database according to login user when he/she leave the site.
请参阅此处的会话状态事件文档: http : //msdn.microsoft.com/zh-cn/library/ms178583.aspx
Unfortunately this question is very close to "I want to save my data after computer is turned off"... Very hard and not predictable.
Now sometimes you can try to handle unload events for browser... you may have enough time to send response sometime.
Probably most reliable solution is to have heartbeat requests from browser and mark users as active this way (in custom database/storage). Periodically check and mark all users that did not send heartbeat requests for some time...
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.