While I agree with you that putting session data in a cookie is a risky idea, I had a question:
> I have even written my own session handling wsgi middleware just because I don't understand encryption and cannot find a framework that doesn't try that.
You wrote your own library that stores in plaintext because you weren't sure that pre-existing libraries were doing crypto correctly?
Why couldn't you treat those other libs' ciphertext as plaintext and apply your custom security engineering to it.