Use the docstring to document the external behavior of the function.  Other commentary can go in comments.

I wonder if there isn't a place to put this that is more central to login/logout behavior so that it can all be in one place.