(3)A person arrested under this section may be detained until his name and address have been correctly ascertained:Provided that no person so arrested shall be detained longer than may be necessary for bringing him before a Magistrate except under the order of a Magistrate for his detention.