Running object.clear_association_cache before storing it in the session should do the trick.
-Jonathan.