def new_csrf_token(self, session_key):
try:<EOL><INDENT>csrf_token = self._generate_csrf_token()<EOL>session = self._lookup_required_session(session_key)<EOL>session.set_internal_attribute('<STR_LIT>', csrf_token)<EOL>self.session_handler.on_change(session)<EOL><DEDENT>except AttributeError:<EOL><INDENT>raise CSRFTokenException('<STR_LIT>')<EOL><DEDENT>return csrf_token<EOL>
:rtype: str
:returns: a CSRF token