0

I have a problem with running my project using docker on mac.

the problem lies while invoking the endpoint that sets the session

I get two warnings when running the project

first warning:

Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[60] Storing keys in a directory '/root/.aspnet/DataProtection-Keys' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed.

second warning

Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35] No XML encryptor configured. Key {25ffec84-775f-44d0-9dce-5b4824e3fbf2} may be persisted to storage in unencrypted form.

Session Settings

 services.AddSession(options =>
            {
                options.IdleTimeout = TimeSpan.FromMinutes(12);//We set Time here 
                options.Cookie.Name = "MySession";
                options.Cookie.HttpOnly = true;
                options.Cookie.SecurePolicy = CookieSecurePolicy.Always;
                options.Cookie.SameSite = SameSiteMode.Strict;
                options.Cookie.IsEssential = true;
            })

somone have idea how i can resolve that ?

Micheal841
  • 11
  • 3
  • What version of Core ae you using. Should be using Core 7 or 8. See : https://stackoverflow.com/questions/55760907/net-core-warning-no-xml-encryptor-configured?force_isolation=true – jdweng May 31 '23 at 17:20

0 Answers0