Preserve sessions across forwards

Based on code from #284