The `identifier` feels out of place here: it serves as an argument for callback, which makes the class only support single-argument callbacks, but there's nothing else in the class that would warrant this. (This is visible in the test, that has to deal with `param` and `key` due to this.) I'd argue it should be either removed in favour of `lambda: self._close_session(cookiejarkey)` in the cookie middleware, or be replaced with a more general "callback args & kwargs" params.