Good question. This is how I understand it:
While you are shopping, the web page is partly in a buffer and partly in
the cache. When you exit/close tab/log off, the contents of the buffer
are flushed or overwritten by the next page's contents. The cache may be
flushed when you exit Firefox, depends on your settings. The cache
obviates the need to reload page data when you move to another tab or page.
What remains on the vendor's server? I think it varies, seems to depend
on local privacy laws + vendor's security policies. Eg, although several
vendor's purchase pages here offer to fill in name and address, they
don't have the credit card number. They'll surely have most of your
log-on profile, and a record of what you've bought or looked at.
Firefox also keeps a record of your passwords, which you can
view/extract with suitable utilities.
But the above is certainly incomplete.
--
Best,
Wolf K.
kirkwood40.blogspot.ca