The change is to set the secure cookie on all connectons, and only read the secure cookie on secure connections, I am testing this implementation now.