'Add cookie from user request into server session'

def _add_request_cookie_to_api_session(self, server_session, request, cookie_name):

    user_cookie = None
    if cookie_name:
        user_cookie = request.COOKIES.get(cookie_name)
        if user_cookie:
            server_cookie = {cookie_name: user_cookie}
            if server_session.cookies:
                requests.utils.add_dict_to_cookiejar(server_session.cookies, server_cookie)
            else:
                server_session.cookies = requests.utils.cookiejar_from_dict(server_cookie)
