Any person confined as insane may prosecute a writ of habeas corpus as provided in this chapter; and, if the judge or the jury, when the petitioner demands the issues arising to be tried by a jury, shall decide at the hearing that the person is insane, such decision does not bar a second application alleging that such person has been restored to sanity.
Ala. Code § 15-21-3 (1975)