Hey guys,

What would be the best way to detect if a user has closed the session with my site? I need to update a database table field for a user when he or she exits the browser. Kind of like an online offline system.

To log off, they can either click log off (which is easy to detect), or close their browser (assuming they didn't click "stay logged in" upon logging in) which is hard to detect. So the latter is what I need help with.

Thx!