When running under Apache with 'UseCanonicalName on' and ServerName set to a value that's different than the host name typically used to access the site, the referrer checks in uc_store.module don't work correctly. The symptom of this is that the entered form information is lost if the user clicks the "go back" button on the checkout review page.
When "UseCanonicalName off", Apache sets the SERVER_NAME environment variable to whatever is supplied by the client through the http 'Host' header. Otherwise, SERVER_NAME is whatever the VirtualHost's ServerName directive is.
$_SERVER['HTTP_HOST'] is always the http 'Host' header, and this is certainly what should be used instead of $_SERVER['SERVER_NAME']
Attached patch corrects this.
FAILED: [[SimpleTest]]: [MySQL] 1,156 pass(es), 5 fail(s), and 3 exception(s).
PASSED: [[SimpleTest]]: [MySQL] 1,912 pass(es).
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch fix_uc_store_servername.patch. Unable to apply patch. See the log in the details link for more information.