I have a sites page, and it seems to work fine from a functional perspective. It has a custom controller that retrieves some data from a custom object and the Contact object, displays the data to the user, and lets them submit an updated version of the data into another custom object.
But after a certain amount of time (24-48 hours), when I go to the page I get a 'Not Authorized message'. After much testing, and thinking it was a a problem with css/statis resources, I have now found that the problem seems to be with the controller (i.e. a page with no references to css/static resources still fails)
When I get the error, I can login to SF and simply view the apex controller class in the usual Setup - Develop - Classes interface, and the public sites page then works again for another 24-48 hours.
What am I missing here? I have different versions of the page setup with cache enabled, and with cache set to false - they all fail.