As a rule of thumb, if you don't want this to happen, make sure that you don't place your electronic key card next to your credit cards. Their magnetic strips or chips make them lose their code. If your electronic room key card is demagnetized, be sure that hotel staff asks you for your photo I.D.