Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't think you quite understand the definition of idempotent. A process is idempotent is if the process can be applied multiple times without changing the result achieved from the first application.

In this case, logging out multiple times does not change anything from the first application.



you're making way too much assumption as to what logout does behind the scenes. "without changing result" != "without changing state"

sending notifications, updating counters, etc. all could be result of logging out.


I think it is easy for us to agree in that, from the client's point of view, logging out of a website is idempotent.

Now, you got a point about idempotence from the server's point of view. However, it would take a _badly_ programmed website for the logout operation to _not_ be idempotent. Sending notifications, updating counter, etc. _without first checking if the user is really logged in or not_ is simply moronic. This simple check is what would turn the logout operation into an idempotent one in the server too.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: