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
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.