Improved error handling when decrypting cookies