Automatically Log-Out Users When They Close Their Browser in Flex3
When a user logs in and closes the browser without logging开发者_运维问答 out, I want automatically log out the user in Flex3. Any help is greatly appreciated!
I think the reliable solution is on a server side. For example client pings server every period of time (say every half a minute) and if there wasn't ping for a minute server logs out the user.
You can try using a window.onbeforeunload event and having that call something that is wired up via ExternalInterface which then does the logout. This may or may not work, though. It is pretty quick to get working, though, so it will be easy to test.
I did some searching on the internet and you can achieve this using flex in combination with javascript. Have a look at this thread:
http://board.flashkit.com/board/showthread.php?t=748226
I cannot guarantee this will work since I haven't tried this myself.
精彩评论