Elaine Kasket is a counselling psychologist based in London. Her first book, All the Ghosts in the Machine: Illusions of Immortality in the Digital Age, examines the ethical and technical issues surrounding our data when we die.

If I were to fall under a bus tomorrow, what would happen to my Gmail and Facebook accounts?

Under contract law, privacy ceases on the point of death. But what’s interesting about this area is that big tech treats the erstwhile account holder and their data almost with the same contractual reverence as they would when this person was alive. So they end up privileging that concept over the needs, requests and wishes of the next of kin.

But that’s not what relatives expect; they would assume to inherit data much like they would shoeboxes of letters, photographs and so on.

Exactly. In the UK laws of succession, the two tests are tangibility and value. So if something’s tangible, even if it has no value, you can execute it in a will. Or it will automatically pass to the next of kin if the estate goes to them. So people assume the digital stuff is going to obey the same rules, but it doesn’t.

Generally speaking, what’s the social media company response to relatives’ requests for access to their deceased’s accounts?

Something along the lines of: “We’d love to be able to help you with this but we’re not able to.” They say they are protecting the (technically nonexistent) right of privacy of the deceased. You could call it agency laundering.

Occasionally this attitude has been challenged in court…

One of the most ridiculous cases was where Hollie Gazzard was murdered by an ex-boyfriend. Her Facebook account contained photographs of her with her killer. Facebook told the family that they needed to protect Holly’s privacy by not allowing them to selectively edit her profile.

Hasn’t Facebook recently tried to address some of these problems?

Earlier this month it announced it will be using artificial intelligence to stop profiles from sending out troubling things such as birthday reminders and so on. But for every person who’s upset by a reminder there could be another family member who would mourn their loss. Because the thing is, grief is idiosyncratic. There is no rule book for grief. And if there were one, a profit-driven company, such as Facebook, shouldn’t be writing it.

Facebook’s business model is to collect data to encourage people to buy things. Dead people aren’t consumers. What’s the business case for maintaining memorial accounts?

There are several things. The only reason some people stay on Facebook is that there are memorials for people who are dear to them. And once you deactivate your account, the deceased user is no longer able to re-add you – you are locked out of the cemetery.

Another reason is that even if the person is no longer available to buy something, their data can still be analysed and be valuable to a company for a number of purposes.

They used to cull the accounts of deceased users, but there was user backlash from that. Ultimately, automatic profile retention is the least resource-heavy thing to do.

At some point there will be more dead Facebook accounts than live ones.

The Oxford Internet Institute recently predicted there could be 2bn dead Facebook accounts by the end of the century.

That’s a lot of data…

Although we’re doubling what we can store every couple of years, it’s not, like infinite – and our devices capture more and more stuff by default. That surplus data, either with the aid of artificial intelligence or human decision making will be jettisoned, and big tech will be making those decisions.

Meanwhile, people have to act like hackers to gain access to their relatives’ accounts…

They are forced to break the law. They are impersonating people, using other people’s passwords… but we let it slide, because what else can you do? I’m not sure if I’m happy to leave someone a set of my passwords; they might find things that were important, but they would have access to everything else. Even if one isn’t harbouring toxic secrets, that’s still quite a thing.

Belief in the afterlife is strengthened by the sense that the dead are remaining socially influential via the internet.

Like people, social networking sites, such as MySpace or Friendster, also die…

The Marie Kondo idea that you should be storing all your books, photographs and music in the cloud, so we have nice clean shelves, is great. But just be aware that your grandchildren might know nothing about you – unless someone is taking the time to think: that platform is becoming obsolete, let’s make sure we download an archive. Companies aren’t going to do this for you; they’re not humanitarians, they are profit-based companies. Look at the history of computing: coding changes, hardware changes, software changes. Your data won’t survive. Moreover, you can’t bequeath your collections of music or books – all you’ve done is purchased a user licence agreement limited by your lifespan. The music isn’t yours; what you have is permission to listen.

Have social media changed how we mourn?

It makes the deceased much more present. The industrial revolution, with its hospitals and suburban cemeteries, enabled us to keep death at arm’s length. But the internet is tailor-made for continuing bonds; it makes it exceptionally easy, because the dead live in tech already. There’s dead people’s data everywhere: their Amazon reviews, their Trip Advisor recommendations. You may encounter something that influences you and have no idea whether it is authored by a dead or a live person. The dead remain socially active in a way that is unprecedented. They are undifferentiated, ambiguously there.

You write about people who leave messages on memorial pages who often talk about “getting through” to the deceased…

The sociologist Tony Walter describes how the internet is a particularly amenable place for angels. Historically, angels were messengers between heaven and Earth, but now they inhabit the ether where we can readily access them. Lots of nonreligious people have a belief in the afterlife, and this is strengthened by the sense that the dead are remaining socially influential via the internet.

An idea explored by Black Mirror and others is that we could one day be able to upload the contents of our brain or our consciousness to the cloud and create a hologram or virtual version of ourselves, which people could continue to interact with. Is this wise?

I find it faintly narcissistic. These people are dealing with their own terror of not being alive. They assume people would still like to hear from them when they are dead! Moreover, you may well run into some of the same problems of digital legacy: the platforms need updating, the code ceases to work, and so on.

What’s the bare minimum you’d advise people to do?

It’s a good idea to clean your digital house frequently. If nothing else, you don’t want relatives buried under a hundredweight of undifferentiated data with no sense of what is important to you. The default is to become a digital extreme hoarder, with data up to the rafters. The things which are really important to you, the artefacts you want to pass on to future generations, put them in a physical form. You cannot trust corporations to safeguard your data.

• All the Ghosts in the Machine: Illusions of Immortality in the Digital Age is published by Little, Brown (£14.99). To order a copy go to guardianbookshop.com or call 0330 333 6846. Free UK p&p over £15, online orders only. Phone orders min p&p of £1.99