To my brother, I leave... my Yahoo email account password.

A person’s “digital legacy” – that thoroughly modern concern encompassing one’s electronic correspondence, personal contacts and trove of photographs – is a fiddly inheritance for those already struggling with the loss of a loved one.

Will-writers and tech companies are turning their minds to what customers want done with their email and social media accounts when they are gone.

Download the new Independent Premium app Sharing the full story, not just the headlines

Google is to address the dilemma with a service allowing its users to control relatives’ and friends’ access to their online accounts after they die.

A range of websites, such as Pass My Will, Legacy Locker and Deathswitch, have emerged in recent years, helping people to administer post-mortem access to their digital estates with “e-wills”. Currently, Google will grant access to a deceased’s family members only in exceptional circumstances. Facebook will not give access, instead offering families the option to transform the deceased’s page into a memorial. Twitter will not provide access but will deactivate an account.

Allowing relatives or close friends to view emails, for instance, could help them to locate important documents stored electronically – but would also open up all archived conversations.

Google’s new service, entitled “Inactive Account Manager”, gives users the option to delete the contents of their accounts, including their Gmail inboxes, should they remain inactive for three, six or nine months.

Alternatively, data can be passed on to selected contacts from all Google services, including YouTube, Google+ and the user’s address book. Nicola Plant, partner at the solicitor Pemberton Greenish, who has written a research paper on digital estates, welcomed the move. As it stands, she says, access tends to “die with you”.

There have been two recent test cases in the US. In 2010, the parents of a 21-year-old who committed suicide without leaving a note successfully challenged Facebook and Google’s refusal to hand over their son’s passwords. They hoped that access to his accounts would offer some explanation for his suicide.

in 2004, the father of a US soldier killed in the Iraqi city of Fallujah wanted to create a memorial from his son’s emails but was denied access to the account by Yahoo! The refusal was later overturned by a court. There have yet to be any such cases in the UK.

More people are choosing to include internet passwords in their wills. “What people have online, their digital legacy, is like a scrapbook with sentimental value,” said Ms Plant. “The question is what of that do you want to be passed on?”

Matthew Strain, a partner at London law firm Strain Keville, says he holds passwords for an increasing number of clients, but that as more of our lives pass into “the cloud”, legal issues arise. “With the advent of Apple Passbook and Google Wallet, as soon as you have the password you have access to someone’s bank account,” he said. “If you leave your money to your wife but your best friend has access, they could spend that money on a holiday to Vegas. Then it would be down to your wife to follow legal proceedings to get it back.”

Both solicitors advise clients to keep an up-to-date list of passwords in a confidential place. Facebook and Twitter have no immediate plans to change their policies on this issue.