When building a web service, logging out is often an afterthought. When you finally get to it, it turns out to be complicated. As a user, you have a couple of reasons to log out from a web service: You want to switch to another account. You want to prevent anyone else (or even yourself) from accessing your account using the same device. We now have multiple devices and the services can be used with browsers and native apps. Sometimes you want to log out of the other devices, for example if yo...