The content of the cookie is up to you, it is more or less a repository of key values in the browsers of your users with an expiration date.
As for the content, for your use case you can use any symmetric encryption, for example Fernet (available in the package cryptography
, cf https://cryptography.io/en/latest/ ).
As far as I know itsdangerous
(from the author of the flags, cf http://pythonhosted.org/itsdangerous/ ) allows you to sign the contents of the cookie, but it does not "encrypt" it (the user can still see the contents, but not change it). itsdangerous
- Dependence on btw flash drives.
source
share