Update cookie logic