I think here what we want is simple. We want a function in the web page that can be called to log out the user. The first thing we need to discuss is what is the best way to call this log out function. I think the best is using a POST request, a reason for this is can be found here in StackOverflow or in this other one. I think that also that with the current design of the web the best will be that the sites implemented a RESTful service for the logout. Any suggestions or comments?
Thank you Pablo for this interesting comment. I wasn't aware of this issue. I'll put it as a note in the main page.