Support passing cookie to encoder