Twitter will allow a designated party to deactivate your account without needing your password, but it requires a heck of a lot of paperwork. The full article on contacting Twitter about deceased users is worth a read, but in brief: Twitter needs your username and a copy of your death certificate, along with a signed statement from your loved one explaining who they are, how they know you, proof that the Twitter account belonged to you (if your username doesn't match your real name), and a copy of a government-issued ID (such as a driver's license) that proves their identity. They then have to fax or mail all of that to Twitter--the appropriate address and fax number are both on the page for the Twitter Help Center.
Facebook requires a similar amount of information, but it at least provides an online form to help your friend or family member submit the information quickly. Facebook also goes one step above and beyond deactivating or deleting your account: Your loved ones can convert your Facebook page into a memorial page that has higher security and allows friends and family to post memories about you on your timeline.
Entrust a loved one with your digital estate
Facebook's neat/creepy memorial account feature aside, in most cases, it's much faster and easier to provide your login information to a trusted friend or family member, along with instructions to delete your accounts after you've passed away. Asking a loved one to delete your Facebook account after you die is way more efficient than having to verify your death with Facebook, which can often take several days. Deleting your Twitter account is even easier--just head to "Deactivate my Account" at the bottom of your account settings page, follow a few instructions, and you're done.
Deleting your information isn't the only reason you should keep a record of your passwords on hand for loved ones. Because most online stores like iTunes are actually selling you a license and not the media itself, you can't count on retailers like Apple to help your loved ones get into your account. If you download or stream a lot of media, your passwords may be the only things that keep your music and movies in the family.
Build your own dead man switch
If you feel uncomfortable giving out your account passwords while you're still alive and kicking, you could always set up a dead man switch of your own to send out that information. I recommend using free services like the appropriately named Dead Man's Switch or Deadman. Both will securely provide the previously mentioned password and other personal information to your loved ones after your death.
Sign up for CIO Asia eNewsletters.