Have you ever wondered what happens when you die?

You’ve probably heard about how those who have died and come back to life say they saw light at the end of a tunnel.

Or that they floated above their bodies, watching as doctors frantically worked to keep them alive.

But until now, it was not known if the mind kept working after the body died.

Just like the remake of the ’90s cult horror “Flatliners,” starring Ellen Page, scientists have discovered that a person’s consciousness continues to work after they have died.

In the film, a group of young doctors conducts a dangerous experiment to see what happens in the afterlife by taking turns stopping their hearts.

Dr. Sam Parnia and her team from New York University Langone School of Medicine had the same question.

They set out to find the answer in a much less dangerous fashion, looking at studies in Europe and the US on people who have suffered cardiac arrest and “come back to life.”

“They’ll describe watching doctors and nurses working and they’ll describe having awareness of full conversations, of visual things that were going on, that would otherwise not be known to them,” Parnia told Live Science.

Their recollections were also verified by medical staff who reported their patients could remember the details.

Death, in a medical sense, is when the heart stops beating and cuts off blood to the brain.

This means the brain’s functions also stop and can no longer keep the body alive.

Parnia explained that the brain’s cerebral cortex — the so-called “thinking part” of the brain — also slows down instantly, and flatlines, meaning that no brainwaves are visible on an electric monitor, within 2 to 20 seconds.

This eventually results in the death of the brain.

Parnia and his colleagues are also observing how the brain reacts during a cardiac arrest to determine how much of these experiences relate to brain activity.

“At the same time, we also study the human mind and consciousness in the context of death, to understand whether consciousness becomes annihilated or whether it continues after you’ve died for some period of time — and how that relates to what’s happening inside the brain in real time,” he said.

It is not the first time brain activity after death has been recorded.

In March, doctors at a Canadian intensive care unit discovered that one person had persistent brain activity for up to 10 minutes after they turned off their life support machine, but three others did not.

For more than 10 minutes after the medics declared the person clinically dead, brain waves, like those we experience in our sleep, continued to occur.

The researchers also found the experience of death can be very different for individual patients.

Each patient recorded different electroencephalographic results — the electrical activity in the brain — both before and after death.