get Session::save_as() working much more correctly, and cleaner