modify cookie value according to the one returned from remote API