encode as much information as possible in session metadata