<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 async def save(self, request, response):
 """Save session to response cookies."""

        if isinstance(response, Response) and SESSION_KEY in request and not response.prepared:
            session = request[SESSION_KEY]
            if session.save(response.set_cookie):
                self.app.logger.debug('Session saved: %s', session)