added a test for protocol mismatch, cleaned up some php warnings, removed the 'use http cookie'