Safari stopped remembering what is usually stored in cookies. What might have happened? For the last few days Safari has simply stopped remembering thing, like my login id for several Web sites (but not all, not StackExchange for example) and form data that is stored in cookies (like my name and address on the pizza delivery site I use).

Private Browsing is not active.

What might have happened and how can I fix it?

This is Safari 5.1.2.
Saved forms and cookies are not the same thing. Cookies (for example) keep you logged in to a website, instead of having to re-log-in every time you visit. Saved forms are Safari's way of keeping text in a login form, so when you are logged out you don't need to enter your credentials again.

It sounds like you're talking about saved forms. To make sure this is working, go to Safari > Preferences > AutoFill and make sure "User names and passwords" is checked.