Session defaults getting unset after website restart or upgrade

We have a setup that gives document names based on location. And I have setup it up like this. In session defaults user sets the city location and based on that doc looks like this for New Castle DOC-NC-230001 and for Belfast like this DOC-BF-230001. But after any work is done on the server session defaults has to be set again or the document will go to default DOC-230001. This annoys our personnel and they are secretly hating this implementation. Is there a better way to set permanently location of frappe user, or any value for that matter?