By observing the HTML of the about:preferences#privacy page, we can find that the checkbox "Cookies" has a preference value of network.cookie.cookieBehavior
, as does the dropdown next to it, so that's the preference value that is changed.
You can see in the console of about:preferences that if you type in Services.prefs.getIntPref('network.cookie.cookieBehavior')
it will return a 1. You can also see this if you have about:config open as you are toggling the preferences dropdown - the value will change there.
Hope that helps!