(Photo: Javier Brosch/Shutterstock)

Can a dog be so happy that it passes out? Thanks to a recent viral video, in which a young woman returns home from a two-year absence and her dog appears to cry until she faints, approximately 30 million people know the answer is yes.

"The emotional life of a dog—the entire mental life of the dog— is very close to a human two- or three-year-old."

As far as instant Internet “awws” go, videos of dogs whose owners have just returned home are some of the most reliably adorable and tear-inducing. Soldiers’ homecomings tend to be the most emotional—not only are the dog and soldier overjoyed to see each other, the person holding the camera often gets choked up as they coo in baby-voice to the dog, “Who’s home? Who’s home?”

The dogs have varying reactions: Some bolt around the room in circles, with so much energy that they couldn’t possibly stay still. Others will climb and tackle the returning soldier as if he were holding a large steak. The impression we get, as observers, is always the same: The dog is ecstatic that its owner has returned safely from war. But what's really going on in that doggie brain of theirs?

DOGS HAVE BEEN GOING buck-wild upon the return of their long-departed masters since long before we could post videos of their reunions online. The stories even go as far back as Homer’s Odyssey. “Ulysses has all those trials and tribulations after the fall of Troy," says Stanley Coren, professor emeritus at University of British Columbia and author of The Wisdom of Dogs. "He comes back home and there’s all these people trying to vie for his wife Penelope. He returns in disguise to see what the hell is happening. There, looking like a pile of trash, looking not healthy at all, is the dog Argos.... Nobody in the state recognizes him except his dog Argos.”

Sadly, Argos dies shortly thereafter, but not before he had, as Homer writes, “fulfilled his destiny of faith and seen his master once more after twenty years.”

The truth is, Coren says, dogs have very good memories of their caretakers. Much like humans, dogs remember the most when there are strong emotions attached to the memories.

“The emotional life of a dog—the entire mental life of the dog—is very close to a human two- or three-year-old,” Coren says. “A two- or three-year-old will have love and joy and fear and anger and surprise, but they tend not to have the higher social emotions like guilt ... pride, shame, that sort of thing.”

"One of the things that’s clear from videos with soldiers, is that the soldiers and families are all wired too, and the dogs pick up on that."

A dog will associate these emotions with the various sensations that the human provides—sight, sound, and, most importantly, smell. “They basically assess this complex of sensations, which is in fact a person," Coren explains, "and that will trigger the emotion.” A study covered in Pacific Standard earlier this year showed that there is even a specific area in a dog’s brain that lights up when it smells a familiar human.

When those sensations are activated, the dog will exhibit behavior that they typically produce when that human is around—like a specific greeting behavior, or nosing around in your hands and pockets for where you keep the treats. “There’s no doubt that dogs have very specific memories," says Marc Bekoff, author of Why Dogs Hump and Bees Get Depressed. "They recognize individuals. There’s a lot wrapped up in that relationship of care, love, and affection.”

If a dog’s caretaker leaves for a long period of time, it will likely go through a grieving period, says Bekoff, who co-founded an organization dedicated to ethical animal studies with Jane Goodall. “It’s a loss—an unpredictable loss—because the person can’t say, ‘I will be back in two weeks.’”

“Nobody really knows much about the dog’s memory in terms of when the dog goes into that state of wondering if a person is coming back,” he adds.

THERE'S NO SOLID EVIDENCE that the dog reacts more strongly when a human has been gone longer, but a few factors are at play. First, Bekoff says, dogs are creatures of habit. So when you return home from work every day, the dog is happy to see you, but it also expected your return. If you are leaving for longer than usual, it might sense that the event is more unusual and react more strongly. The other factor, according to Bekoff, is that the humans involved in the event also get more excited when someone returns from a long absence. “One of the things that’s clear from videos with soldiers is that the soldiers and families are all wired too, and the dogs pick up on that.”

Another possibility is that the dog simply reacts in the typical way it greets its master, but since the family (or observers on YouTube) haven’t seen the behavior for a while, it appears exaggerated. “In that excited state," Coren says, "they perform the same affectionate behaviors they always reserve for that individual.”

If you plan on leaving your four-legged friend for an extended period of time, Coren and Bekoff agree that anecdotal evidence suggests they will remember you for quite a while. Unless, Coren says, the dog is younger than six months—in which case, “The new emotions and bonding which took place beyond six months when you were already gone will swamp the earlier memories.” Or if the dog gets very old and develops a form of doggie Alzheimer’s disease, called "canine cognitive dysfunction," which makes them likely to forget memories, especially the emotional ones.

These are sad possibilities, but, for the most part, adult dogs will remember their masters for years after they depart. The way a dog bonds to its human caretaker is very strong, Coren notes. “He thinks the person is part of his family or pack.”