New York mayoral candidate and former congressman Anthony Weiner just apologized for carrying on digital relationships involving phone sex and racy online messages -- yes, again.

Public figures have been having affairs since the invention of the term "public figure." But Weiner's behavior is a good reminder that even when someone is taking precautions -- Weiner reportedly adopted the handle "Carlos Danger" to cover his tracks -- it's almost impossible to carry on an online affair without getting caught.

For example, even retired Gen. David Petraeus was unable to hid his affair with his biographer, Paula Broadwell. And Petraeus was the director of the CIA! While they attempted to hide their tracks by leaving messages as drafts in a shared webmail account created using an alias, the IP addresses used to access the inbox were used to pinpoint Broadwell's identity.

That elevated risk is relatively new. Sure, there was always the risk that Lucy Mercer Rutherfurd might share a handwritten note from FDR with a reporter. But she didn't have the ability to photocopy it, or to e-mail it to friends at the click of a button. Technology has opened up many new ways for a politician's scorned lover to capitalize on their story with a vast trove of evidence.

Mobile apps like Snapchat promise ephemeral communications, claiming to delete photos a few seconds after they're received. But computer security professionals have discovered that there are ways to copy Snapchat photos and keep them permanently.

And even if a scorned lover has no interest in publicizing an affair, evidence may just be sitting in an e-mail account waiting to be hacked. No matter how careful you are, there's a risk that your illicit partner will get careless and reveal information about your liaisons.

In short, once you release information on the Internet, you can never be sure it's been completely removed.