save the state file under static/data/states/userid