It used to be so easy: your photographs filled up boxes and albums; your CDs, books and films filled up shelves; your thoughts and ideas filled up notebooks and diaries, and when you died there were physical things to be distributed among your family and friends.

Technology has changed the way we keep and share our memories, and also the way many of us own our books and music. News that Bruce Willis is reportedly considering legal action against Apple to make sure he can leave his virtual record collection to his daughters will have surprised anyone who thought their online possessions were theirs to dispose of as they choose. So what rights do you have over the accounts and goods that exist only virtually?

"Across the world the law is in a state of flux – it hasn't evolved to keep up with innovation in digital content," says Jas Purewal, interactive entertainment and digital media lawyer at Osborne Clarke. "It is set up to deal with physical goods, and it is not clear therefore what the position is with social network accounts, iTunes accounts, your subscription to Netflix, and so on."

There are not yet statutory laws around ownership of virtual goods, nor is there case law. The EU is looking at consumer protection in this area, but nothing has yet been passed, so Purelaw says it is being left to the providers of content to decide what they will allow consumers to do with items they buy and share online. He says there are promising signs judges recognise that virtual content can be owned like physical content, citing the 2011 case of a man jailed for stealing online poker chips.

Music and films

You might be surprised to find that in most cases you are effectively leasing the content, not buying it. This is because you are generally being sold a licence to use the song or film, not the item itself. Where the music is downloaded on to a device you can leave that to someone, but you cannot leave instructions to share out the holdings in your iTunes account after you are gone.

When it comes to the account's contents, "from a legal perspective there is nothing to leave," Purewal says. He works with online entertainment companies and says: "I can't think of any digital content providers who freely and openly allow the passage of ownership from one person to another." Either the terms and conditions will explicitly rule out sharing downloads, or will use language which implicitly rules against it.

Workarounds are possible: you could share your password and other account details with your family or even the person who will execute your estate, but you will be taking a risk as the content provider could suspend the account. But if US courts do decide iTunes has to allow users to pass on licences, this whole area may be opened up.

Books

As with music and films, when you die your virtual library will die with you. Amazon tells Kindle users: "The purchase and download of digital content from Amazon.co.uk, including content from the Kindle Store, is associated with the Amazon.co.uk account used to make the original purchase. As a result, Kindle content cannot be shared like a physical book."

So you can't move a book from one device to another, and you won't be able to split up a collection of books between family and friends. You could leave the device holding your collection to someone else, but if they needed to access the account for any reason they could run in to difficulties. Again, you cannot leave it to someone else with complete certainty.

Social media

"Most social media account holders are bound by their terms of business, and it is common for executors to be unable to access a deceased's customers account," says Nick Rhodes, associate solicitor at Blacks Solicitors. "The service providers seem reluctant to allow access as the accounts contain personal data about the deceased and fear breaching privacy rights. There is no established legislation or cases dealing with the release of personal data to executors."

Facebook's terms and conditions include the line: "You will not transfer your account (including any Page or application you administer) to anyone without first getting our written permission", which effectively rules out handing over your account when you die. However, it will let your family turn your page into a memorial page, provided they provide proof of your death.

Twitter says that when you sign up it "gives you a personal, worldwide, royalty-free, non-assignable and non-exclusive license to use the software", which implies an account cannot be transferred. It seems unlikely it would pursue an individual for logging into a relative's account after their death, but there are inactivity rules. Your account will not stay around forever if nothing is happening with it.

Yahoo!, which owns the photo-sharing site Flickr as well as running a webmail service, also states that users are granted "personal, non-transferable and non-exclusive right and licence" to use its software. It also makes it clear in its terms and conditions that it reserves the right to shut down inactive accounts. This is worth bearing in mind if you want to pass on photos which you are storing online – the account holding them could be deleted one day.

Despite these rules some companies are trying to trade on the idea that people may want to leave their accounts to their families when they die. Loccit, for example, offers to pull together your Facebook, Twitter, Instagram and Foursquare accounts to create an online version of "the secret shoebox of photos and memories we used to keep as children".

iCloud

Apple is very clear about ownership of iCloud accounts. It states in its terms and conditions: "You agree that your Account is non-transferable and that any rights to your Apple ID or Content within your Account terminate upon your death. Upon receipt of a copy of a death certificate your Account may be terminated and all Content within your Account deleted."

Emails

English law states that the copyright of emails and other material stored online forms part of people's estates, and should therefore pass to executors. However, lawyers say internet service providers do not always allow access. There can also be jurisdictional issues where ISPs may be based in a different country to where the user lived.

Rhodes says anyone worried about their digital legacy should "have a will stating that chosen executors have the right to access social accounts and digital assets, and to direct the executors on how the accounts and assets shall be dealt with.

"If the executors still meet resistance from the online providers then they could apply to court for an order allowing them to deal with everything in accordance with the will."

However, he says it remains to be seen how a court would react.