RedisSessionProvider icon indicating copy to clipboard operation
RedisSessionProvider copied to clipboard

Session keys should be case-INsensitive to match default ASP.NET behavior, or at least configurable

Open devmonkey22 opened this issue 9 years ago • 1 comments

When switching from StateServer to RedisSessionProvider, I found that you're handling session keys case-sensitively, because you're using the default ConcurrentDictionary IStringEquality behavior.

MSDN docs don't specify, but at least based on Internet discussions: http://stackoverflow.com/questions/1731283/net-httpsessionstate-case-insensitivity that to match classic ASP behavior, session keys along with other ASP.NET collections are case-insensitive.

To fix, all constructors need the following:

this.Items = new ConcurrentDictionary<string, object>(concLevel, numItems, StringComparer.InvariantCultureIgnoreCase);
this.SerializedRawData = new ConcurrentDictionary<string, string>(StringComparer.InvariantCultureIgnoreCase);

devmonkey22 avatar Oct 08 '15 22:10 devmonkey22

Seems this commit is merged. Could you please close the ticket and publish new version to the Nuget?

hmvs avatar Jan 21 '16 12:01 hmvs