From Player A's first statement, we know that
S must be odd.
If S were even, then there's always the possibility that x and y could both be prime. In that case, P would a product of two primes, which would give away x and y for B, contradicting A's first statement that such a thing must be impossible.
By the exact same token,
Any odd S which is two larger than a prime is impossible.
In addition to that,
There are some number pairs (like x=10, y=25), where you have composite numbers on one or both sides, but given the restriction that x+y < 47, the factorisation of the product is unique.
These are the sums that I found that weren't excluded by the previous two steps. Each is listed with one possible pair of x and y for which the product would give away the factors: 27 (4, 23), 29 (6, 23), 35 (4, 31), 37 (6, 31), 41 (4, 37), 47 (4, 43).
Here are the disqualifying reasons for all the possible sums S, given as the number of the spoiler block that disqualifies them:
Ones:| 0 1 2 3 4 5 6 7 8 9
--------+-----------------------
Tens: 0 | - - - - 1 2 1 2 1 2
1 | 1 1 2 1 2 1 1 2
2 | 1 2 1 1 2 1 3 1 3
3 | 1 2 1 2 1 3 1 3 1 2
4 | 1 3 1 2 1 2 1 3 - -
So B knows that A's sum must be one of the remaining numbers:
11, 17, or 23.
From B's first statement, we know that
B's product must be expressible as a product of two numbers in (at least) two different ways, so that one way corresponds to one possible sum, and the other corresponds to another. If that weren't the case, then B would know x and y at this point already.
By listing all the possible number pairs (of which there are 21 at this point), and cross-referencing the products against the sums, we find that B's product must be one of the following:
30: (5,6, sum 11) or (2,15, sum 17)
42: (3,14, sum 17) or (2,21, sum 23)
60: (5,12, sum 17) or (3,20, sum 23)
Out of these possibilities, the only product, where knowing the sum would help A know x and y is
the first one, particularly the one with x=5, y=6, because if the sum were either 17 or 23, there would still be several choices, and A's second statement would be false.
Therefore, even before B's final statement (which naturally does fit, since even we now know the numbers), we have deduced that
x=5, y=6, S=11, P=30