fix cookie set issue on unit tests