Patch to make secure pages work

This is xjm's patch to make secure pages work.

This patch is currently being used at http://www.ontourlive.com/ and also being used less extensively on http://www.rideclever.com/ both hosted on pantheon.

It also includes grendzy's unit test. From reading the issue tracker on DO there are issue with the unit test. But, the eventual solution to the unit test issue looks like it will be based on grendzy's patch.

One issue that is possibly a secure pages issue, (but possibly a browser security issue) is that   on the first http->https a new cookie set on the https page so shopping cart info is lost

This means that all landing pages that allow an anonymous user to add an item to a cart must be served over ssl.

This also means that login forms on http pages do not work.