def destroy_digidoc_session(self):
<EOL>self.destroy_digidoc_session_data()<EOL>try:<EOL><INDENT>session = self.request.session[self.DIGIDOC_SESSION_KEY]<EOL>if session:<EOL><INDENT>try:<EOL><INDENT>service = self.flat_service()<EOL>service.session_code = session<EOL>service.close_session()<EOL><DEDENT>except DigiDocError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>del self.request.session[self.DIGIDOC_SESSION_KEY]<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>
Closes DigiDocService session and clears request.session[I{DIGIDOC_SESSION_KEY}]