For that, you would need to look at your implementation... how are you grabbing the values, from where (whether it be a session storage, local storage, cookie, data layer, etc), what code is setting that particular value that you are grabbing, etc.
As much as we would like to help you, we know nothing about your site or implementation, or the logic behind what values are being set where, or how you are extracting them.