Persist ASP.NET Core auth cookies between docker image launches Persist ASP.NET Core auth cookies between docker image launches docker docker

Persist ASP.NET Core auth cookies between docker image launches


You want to put the keys for data protection into a persistent and shareable location.

If you're on AWS, AspNetCore.DataProtection.Aws allows to put the keyring on S3 with just a few lines of configuration code. Additionally you can leverage AWS KMS to encrypt the keys, which is especially useful to achieve consistent encryption algorithms, allowing to reuse the same key accross different operating systems which have different default encryption algorithms. The KMS option is also part of the same library.

If you're on another platform than AWS, you'll need another library or mount a shared drive. But the concept of sharing the same location for the keys remains the same.