Haproxy Cookie Encryption Set Header

I encrypt cookie in lua script but i want to change Cookie value with encrypted cookie in request header. I tried ‘req_set_header’ function in lua but it doesn’t work. Please, help me.