WARNING: THE FOLLOWING COLUMN IS BRIMMING WITH SPOILERS ABOUT MOVIES OLD AND NEW. IF YOU HAVEN’T SEEN “DEADPOOL 2” YET AND YOU’RE PLANNING TO SEE “DEADPOOL 2,” DON’T GET MAD AT ME IF YOU READ THIS BEFORE SEEING “DEADPOOL 2.”

As you’d expect with a fourth-wall-breaking, wink-at-the-viewer film such as “Deadpool 2,” the bonus scenes popping up during the closing credits are especially clever and self-referential.

My favorite involves Ryan Reynolds’ Wade Wilson/Deadpool traveling back in time to dissuade Ryan Reynolds from doing the 2011 disaster that was “Green Lantern.”

And when I say dissuade, I mean Deadpool approaches Reynolds as the actor holds the script for “Green Lantern” — and he shoots Reynolds in the head.

• • •

The movie is over — but wait, there’s still a bit more of the movie to come. It’s like a little cookie placed on the saucer of your after-dinner coffee.

In the Marvel Universe, the end credits bonus scene, or “stinger,” or “cookie,” has become such a staple that diehard fans stay in their seats at the end of the movie, patiently waiting for their treat.

But the cookie is not a 21st century innovation. It goes back at least 60 years. (Some say it goes all the way back to 1903’s “The Great Train Robbery” when the story ends, and  the lead villain — who has just been killed — reappears and takes direct aim at the audience and fires.)

In the original “Ocean’s 11” — I mean the original-original, from 1960 — after the dramatic conclusion of the story proper, we dissolve to a shot of Sammy Davis Jr., still in character, walking down the Strip in the cold light of day as the soundtrack plays Davis singing “Eee-Oh-Eleven”:

“Show me a man without a dream, and I’ll show you a man that’s dead …”

Frank Sinatra (from left), Dean Martin, Sammy Davis Jr., Peter Lawford and Joey Bishop in "Ocean's 11" (1960).

Frank Sinatra (from left), Dean Martin, Sammy Davis Jr., Peter Lawford and Joey Bishop in “Ocean’s 11” (1960). | Warner Bros.

We see the rest of the gang, as the credits start to roll, listing Peter Lawford, Frank Sinatra, Dean Martin, et al. Eventually they walk past a marquee for the Sands, advertising a show starring …

Frank Sinatra, Sammy Davis Jr., Dean Martin, Peter Lawford and Joey Bishop.

Rat Pack meta!

• • •

Starting with “From Russia With Love” (1963), the James Bond films would feature a title card after the end credits, announcing the next adventure:

“NOT QUITE THE END

“JAMES BOND will return in the next Ian Fleming thriller, GOLDFINGER.”

The 1979s classic — yes, classic — “The Muppet Movie” is often credited as the film that took the end-credits cookie to the next level.

After “THE END,” we see the Muppets in a movie theater, reacting to the movie itself. It ends with Animal telling the audience to “Go home!” (Seven years later, a post-credits Ferris Bueller would echo the line, saying to the audience, “You’re still here? Go home!”)

I loved the stinger in “Airplane! (1980). At the beginning of the film, pilot turned cabdriver Ted Striker (Robert Hays) tells a passenger, “I’ll be right back!” and then races into the airport.

We quickly forget about that passenger as the “Airplane!” adventure unfolds — but, during the end credits, we return to the poor guy, who is still in the back of the cab and says, “Well, I’ll give him another 20 minutes, but that’s IT.”

• • •

Another batch of cookies: the end-credits “blooper” sequences, featuring the actors from the comedy we’ve just seen improvising jokes and/or screwing up lines, prompting uproarious laughter from the performers and the crew.

As a rule, the less funny a comedy is, the more likely we’re going to see a blooper reel during the credits. The father of the blooper reel is stuntman-turned-director Hal Needham, who spotlighted Burt Reynolds messing up lines and cracking wise in the end-credits sequences for movies such as “Smokey and the Bandit II” and “The Cannonball Run.”

Burt Reynolds and Sally Field in "Smokey and the Bandit II."

Burt Reynolds and Sally Field in “Smokey and the Bandit II.” | Universal Pictures

Perhaps the most tone-deaf gag placement of a gag reel: After the beautiful and provocative and sly and elegiac “Being There” (1979) with an ending that invited thoughtful and passionate debate, we were shown a scene of Peter Sellers repeatedly flubbing his lines in a scene that wasn’t in the final cut of the movie. Sellers was reportedly furious at the studio for undercutting the movie with the cheap stunt.

We’ve experienced tasty cookies in movies ranging from “School of Rock” to “Ghost World” to “Star Wars: Episode 1 — The Phantom Menace” to the “Harry Potter” movies to countless Pixar films to “Saving Mr. Banks,” but by far the most highly anticipated and most obsessively dissected cookies of the 21st century are created in the Marvel Universe.

One of my favorite Marvel cookies was the “Iron Man 2″ after-credits scene, set in New Mexico. Agent Coulson gets out of a car and observes a giant crater buzzing with activity.

He pulls out his phone and says, “Sir, we’ve found it.”

Zoom in on a close-up of … THOR’S HAMMER.

Too great. Sure, it’s really nothing more than glorified advertising but still: too great.