Fix bug in loading file URLs

The code assumed there would be a header in this case as well. Only use the header when the protocol name begins with »http« now.

Replace (non-existant) variable $basePath with $sitePath in path comparison for cookies (new line 165)