So true. I'm occasionally confused on which spelling to use. My rule of thumb is using "referrer" for almost all place including variable names, except for the situation when I have to manipulate the headers directly.
i've finally got my brain wrapped around to believing that referer is the correct spelling within the context of HTTP. Any time i need to talk about a referer, it's spelled referer. if it's spelled referrer, it must mean something else.
Reminds me when I have to pronounce router the network thing vs router the woodworking tool. The former is pronounced the USA way, the latter the English way.
If I've learnt anything in programming, it's that inconsistent naming just adds useless complexity. At some point, you'll find yourself having to map from 'referrer' to 'referer'; that's entirely wasted effort. Wherever possible, name everything (variables, array indices, filenames, database fields, HTML input names) exactly the same.