Thanks a lot for the detailed reply, Jerry.
As I was trying out your suggestion, I noticed a flaw in my code:
Towards the top of the page, before any processing, I set:
$cart = $_SESSION['cart'];
So, I think the page is grabbing the previous values of the session
values and using them, not resetting them according to what the user
enters into the form. I think that's the problem.
So, I moved
$cart = $_SESSION['cart'];
further down the page after the code that checks for any form values
and changes the session values to what's in the form.
This seems to have fixed my problem. At least I think so...for now.