to implement cookie support for redirect mode