Why logout doesn't work from my extension

From Joomla! Documentation

There was a security fix in Joomla 1.6.1 to prevent users from being logged out from the site just by visiting a wrong page.

If you are getting Invalid token when you click logout, you need to add the token to the request. To find out more about how to do that, read Secure coding guidelines#Securing forms.