New york constitution
Article II: suffrage
Section 4

For the purpose of voting, no person shall be deemed to have gained or lost a residence, by reason of his or her presence or absence, while employed in the service of the United States; nor while engaged in the navigation of the waters of this state, or of the United States, or of the high seas; nor while a student of any seminary of learning; nor while kept at any almshouse, or other asylum, or institution wholly or partly supported at public expense or by charity; nor while confined in any public prison.