class CounterResource(Resource):

    def render_GET(self, request):
        session = request.getSession()
counter = ICounter(session)
counter.value += 1
return 'Visit #%d for you!' % (counter.value,)
resource = CounterResource()
how to use session/cookie in twisted.web?