When any officer within compacting states, in conformity with a valid writ, order of court or the provisions of this compact, arrests a person in or transports a person through a compacting state, the right of said officer to the custody of a person and to use the state penal institutions or county jails for temporary lodging of such person shall be recognized by the compacting states, their courts, and their court officials, as though the person were in custody of the sheriff or proper officer of the compacting state where the arrest is made or through which he is transported.