I see some confusion in this thread. If you buy stocks for dividends, you need to understand how they work. There are four dates involved with each div, and two of them are of particular importance.
This is when the company announces the amount and what the other dates are. Even when it's a quarterly dividend that you just expect, there's always a declaration date when they confirm what's going to happen.
Following the declaration, all brokers are asked to report to the company how many shares are in each persons account. But share are still moving around, and obviously they don't want to count anyone twice. So they pick a specific point in time to do the counting.
The ex-dividend date is the day after that counting was done. (Hence the "ex".) You must own the stock before this date to be counted as a shareholder for the dividend. As of the ex-dividend date, the headcount was already done and you're too late.
Then the brokers send the owner data to the company. Although communication is instant nowadays, by tradition there are several days to allow for delays in the process. So they have a
Which means absolutely nothing to you for the shareholder. It only has meaning for the brokers, who must get their reports in by this date so the company knows who to cut checks to. And then when do the checks go out?
This is when the money comes to the people counted way back before ex-dividend. It doesn't matter if you still hold the stock or not. If you were holding into the ex-dividend date, then you're getting your money on this date.
So for COST's special dividend:
Declare Date: 11/28. This is when the special dividend was announced.
Ex-Dividend Date: 12/6. The count was done the night before this, so 12/5 was the latest you could have bought. Anyone holding overnight from 12/5 - 12/6 will be getting a check for $7 which is why COST opened $7 lower.
Date of Record: 12/10. Meaningless to you.
Payment Date: 12/18. This is when the cash comes to those owning into ex-div.
In short, anyone who bought on 12/6 or later got in after the $7 drop because they won't be getting any dividend.