I have an asp.net application (.net version 6) configured like this:
var redisConnectionString = "fakestring";
builder.Services.AddStackExchangeRedisCache(options =>
{
options.Configuration = redisConnectionString;
});
builder.Services.AddSession(options =>
{
options.Cookie.Name = "fakecookiename";
options.IdleTimeout = TimeSpan.FromMinutes(builder.Configuration.GetValue<int>("SessionDefaults:IdleTimeoutInMinutes"));
options.Cookie.SameSite = SameSiteMode.None;
options.Cookie.SecurePolicy = CookieSecurePolicy.Always;
});
I use the latest StackExchange.Redis nuget package (2.7.33) after numerous issues losing the Redis connection when swapping slots up to 20 minutes before stable again.
Now my Redis connection seems stable when swapping but a new issue arises.
After swapping slots (all application settings aren’t slots specific) my browser gets a new Session Cookie. So i’m actually losing my session resulting in Session Expired exceptions in my frontend application.
Is there a way to retain the session cookie after a deploymentslot swap?
Thanks already for you help.
Kind Regards