code: def set_cookie_close_window_response(self, account_cookie_value):
          
          response = make_response(
              "<html><script>window.close();</script></html>", 200,
              {'Content-Type': "text/html"})
          response.set_cookie(self.account_cookie_name,
                              account_cookie_value)
          return response
docs: Response to set account cookie and close window HTML/JavaScript.