Change the way sessions are stored (differentiate between staging and production sessions) and fix some stuff