in reply to CGI reading and writing to data files
What the previous posters said :-)
If whatever data you are storing is somewhat related to the system, or performing a system service (for instance, you are providing some sort of administrative web interface, reporting tool(s), etc), on *nix I would say it should be stored in /var/lib/<name> - that is, if you are the admin of the machine.
HTH, telcontar