def create_token(self, request, user, **kwargs):
        odm = request.app.odm()
        ip_address = request.get_client_address()
        user_id = user.id if user.is_authenticated() else None

        with odm.begin() as session:
            token = odm.token(id=uuid.uuid4(),
                              user_id=user_id,
                              ip_address=ip_address,
                              user_agent=self.user_agent(request, 80),
                              **kwargs)
            session.add(token)
        return self.add_encoded(request, token)
Convert a cookie string into a the tuple form returned by
dataset/ETHPy150Open quantmind/lux/lux/extensions/auth/backends.py/AuthMixin.create_token--crossover with--dataset/ETHPy150Open RobotWebTools/rosbridge_suite/rosbridge_server/src/tornado/web.py/RequestHandler._decode_xsrf_token