However, extension cannot be all there is to meaning. For one thing, not all true sentences mean the same thing! And even co-referential terms like those discussed above might come apart when we consider other possible worlds. Let W be a possible world where Kerry won the last U.S. election. Then "the U.S. President" picks out Kerry in world W, but "George W. Bush" certainly doesn't! This suggests a new semantic value, called an intension, which is a function from possible worlds to extensions. (That is, it associates an extension with each possible world.)
Recall that rigid designators (such as names) refer to the same object in all possible worlds. That is to say that they have a constant intension. The intension of 'George W. Bush' is GWB at all possible worlds. But the intension of 'the U.S. President' varies across worlds -- for any given world, it picks out whoever is the U.S. President in that world.
Since the extension of a sentence is its truth value, the intension of a sentence is a function from possible worlds to truth values. The intension of a sentence S tells us the truth value of S at each possible world. But recall that there are two ways we can interpret this. Philosophers since Kripke have standardly employed the subjunctive version, i.e. considering, for each world W, whether S would have been the case if W had been. This yields what Chalmers calls the secondary intension of S. (This is what most philosophers mean when speaking of an "intension", simpliciter.) But we can also appeal to the epistemic/indicative version, where we consider, for each world W, whether S is the case if W is. This yields the primary intension of S.
Note that the two intensions can come apart. For instance, 'water is H2O' has a necessary secondary intension: it is true in all possible worlds considered counterfactually. But the primary intension is merely contingent: it returns TRUE for our world, but FALSE for some others. For example, if we consider as actual a Twin Earth world where our lakes and rivers are filled with XYZ, then we should conclude that water is XYZ, not H2O.
It follows trivially from the definitions that a sentence S is metaphysically necessary iff it has a necessary secondary intension. What's more interesting to note is that S is a priori iff it has a necessary primary intension. After all, the only way we could know something without appeal to experience would be if that sentence is guaranteed to be true no matter which world turns out to be actual. That is, no matter which world we consider to be actual, we see that S is true. That is, S has a necessary primary intension. (And conversely: if it has a necessary primary intension, we can see it will be true no matter which world we consider as actual, so we can know it without appeal to experience.)
This sheds a lot of light on Kripkean cases of the contingent a priori, and the necessary a posteriori. Such cases arise when only one of the sentence's two intensions are necessary, as we saw in the 'water is H2O' example above.
Note that our grasp of primary intensions is a priori. This follows from Chalmers' thesis about the scrutability of truth. We can (given the idealization of perfect rationality) determine the truth value of any of our sentences if given enough information about how the world is. More generally, for any sufficiently complete hypothesis W about how the world is, we can determine whether S is true under that hypothesis -- and we can do this regardless of how the world actually happens to be. So we can know a priori a whole raft of conditional statements of the form 'if W then S'. We just can't know which world W is actual (i.e. which world-hypothesis is true) -- that requires empirical investigation.
Primary intensions thus provide a sort of "narrow content", or that component of meaning which is "all in the head". Its internal accessibility also allows it to play a role close to that of Fregean 'sense' (that broad notion of 'meaning' as tied to cognitive significance). Limitations arise in case of a priori sentences, which all share the same ("necessary") primary intension, despite differing in cognitive significance. More elaborate constructions might overcome this, but I will put the issue aside for now. My main purpose here is not to get into philosophy of language for its own sake, but rather to introduce the 2-D analytical tools that can help us in other areas of philosophy.
[Terminological note: primary intensions are sometimes also called '1-intensions', 'epistemic intensions', or 'A-intensions' (where "A" is for "Actual"). Secondary intensions are sometimes called '2-intensions', 'C-intensions' ("C" for "Counterfactual"), or just plain 'intensions', simpliciter.]
For more detail, see Dave Chalmers' introduction, 'Two Dimensional Semantics'.