You don't need an API for it. Browsers can reject cookies at a protocol level (by simply not sending cookie headers), and indeed used to ask users whether they wanted to allow cookies from a certain domain or not.
You can disable all cookies altogether in at least Firefox and Chrome. You can make them only last for the current session.
You can disable all cookies altogether in at least Firefox and Chrome. You can make them only last for the current session.