I'm working on an e-commerce website and there is the zip code field (in Brazil we call it CEP) that is a data that can be very usefull, for example, I can get most of the address information (city, state, location, street name) and also calculate the shipping cost to that address.

So imagine the user is a guest on the website visiting a product page and type the zip code to get the shipping cost for that product. I assume (also as a user) that it's ok to store the zip code and, if I want to get the shipping cost for another product, the zip is already on the form.

So my question is, should I store the zip code on the storage? Or let the user type it everytime he wants to get the shipping cost or create an account?

If it's ok to save, then where should I save it? SessionStorage, LocalStorage, cookies? I'm afraid to keep the information too much time (LocalStorage/Cookie) and give a sense that the webpage is getting user's information behind the scene.

  • +1 for the interesting qustion about privacy concerns of of users. Maybe you want to rework the headline as it could maybe be confused with asking how to store the info? Commented Feb 25, 2018 at 10:47
  • @greenforest any suggestions? Commented Mar 3, 2018 at 13:02

3 Answers 3


At least here in the United States, the issue of online privacy can be very divisive (personally, I tend to favor privacy settings that provide the most seamless experience rather than the most protective, but there are people who violently oppose the idea of any company having any knowledge of you as a customer/user). I'm not aware of the culture in Brasil, so I'd probably err on the side of caution, as suggested in @Devin's answer.

However, you mention that it is a common feature in Brasil, so perhaps, you could provide a non-obtrusive option to "Remember this CEP." Consider something like the following:


download bmml source – Wireframes created with Balsamiq Mockups

Additionally, after you store it, you should reveal a convenient way to clear it from the device.

Reset CEP

download bmml source



As an user, if you ask me my zip code and I provide it, I'll expect you use it for something useful, like, for example, best options you can offer me, pricing, etc.

And if I check out, I'll expect the info I provide it is already filled, because everything I searched, and every response you gave me is based on that Zip code.


  • You should always provide the means to change that Zip code (or any part of the information I provided). This includes checkout (for example, maybe I entered the zip code of my home and want to receive a product at my office).
  • You should never let me know that you can have more information than I already provided. I want to trust you, and I might know you can get more info from what I gave you, but we'll pretend you only know what I told you
  • Similarly, you should store my information only if I signed up. Otherwise, you can keep a cookie and let me know that MAYBE I was at your site before (was I? what if I check from a public computer, or a friend's one?). Something like "Hey, have you been here before?" would be enough
  • 1
    What additional information are you talking about in your second bullet? Like shopping behavior, product viewing history, and other site interactions? Commented Feb 23, 2018 at 20:43
  • @maxathousand, the OP says " I can get most of the address information (city, state, location, street name)". That would be really invasive, so it's better to play safe
    – Devin
    Commented Feb 23, 2018 at 20:57
  • @Devin about getting the full address information, if it's on the step to register an address, or create an account, it's a common feature here, to fill your zip code and automatically get the full address. I don't think that'll be a problem. In other projects I had complains about not having this feature. But, of course, only related to filling the entire address based on the zip code. Commented Feb 23, 2018 at 21:07
  • well, then there you have a cultural difference, and as such, you should use what is common in your country :)
    – Devin
    Commented Feb 23, 2018 at 22:18

Not storing the ZIP for the current session would be very inconvenient for users if they are usually checking more than one product in a session.

The question is if you would want to persist the info e.g. in a cookie which lasts longer than a session. I would think that the ZIP code is not very sensitive information but this might vary depending on the country/culture.

To be on the safe side you could think about a message next to the input field for the ZIP. Once entered and confirmed, you could show a message "We stored the entered ZIP for your convenience - [delete]". A little link "delete" would delete it from the cookie and instead store the preference not to save the ZIP. And if you track how many users decide against storing this will inform your decision to keep or remove the feature in the future.

  • 1
    To be safe, at least for now, I think I'll be storing on the sessionStorage. Providing a link to delete and test for saved data vs deleted data would require a time I don't have right now (single dev on the project), but it's already on my todo list. I liked this idea. Commented Feb 23, 2018 at 21:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.