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
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...
See the session state events documentation here: http://msdn.microsoft.com/en-us/library/ms178583.aspx