add middleware cookie