For a 1999 infiniti g20 what causes the alarm to go off?

It seems that the alarm will go off if a door that was locked is opened and the key hasn't been in the ignition or used to unlock the door for a while.