Various improvements found necessary.

Flexible SSL type detection, temporarily remove broken clear_cookies() functionality,