Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I would like to save user sessions into redis. So i registered a service overriding the default IDistributedCache
services.Add(ServiceDescriptor.Singleton
And still session is not effected and saved locally
The same solution in a clean MVC site works
Any suggestions ?
Thanks,
you can try somthing like this
var redisConfigurationOptions = ConfigurationOptions.Parse("localhost:6379"); services.AddStackExchangeRedisCache(redisCacheConfig => { redisCacheConfig.ConfigurationOptions = redisConfigurationOptions; }); services.AddSession(options => { options.Cookie.Name = "myapp_session"; options.IdleTimeout = TimeSpan.FromMinutes(60 * 24); });
Already tried that, and after setting a value to session I cannot locate it when inspecting my redis server.
Although when setting a value through the DistributedCache Service directly it works.
I think that some where under the hood umbraco is already enabling the session, i don't know if that is the reason why it is not working
But you want to use session, you can use it at
var value = HttpContext.Session.GetString("Test");
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Distributed session
I would like to save user sessions into redis. So i registered a service overriding the default IDistributedCache
services.Add(ServiceDescriptor.Singleton
And still session is not effected and saved locally
The same solution in a clean MVC site works
Any suggestions ?
Thanks,
you can try somthing like this
Thanks,
Already tried that, and after setting a value to session I cannot locate it when inspecting my redis server.
Although when setting a value through the DistributedCache Service directly it works.
I think that some where under the hood umbraco is already enabling the session, i don't know if that is the reason why it is not working
But you want to use session, you can use it at
is working on a reply...