In theory it looks simple: https://learn.microsoft.com/en-us/dotnet/api/system.web.sessionstate.sessionidmanager.createsessionid?view=netframework-4.8.1
I tried to use the example above to prepare custom session id generator, but it’s completely ignored. My class:
<code>public class GuidAuthSessionIdManager : SessionIDManager
{
public override string CreateSessionID(HttpContext context) => Guid.NewGuid().ToString();
public override bool Validate(string id) => Guid.TryParse(id, out _);
}
</code>
<code>public class GuidAuthSessionIdManager : SessionIDManager
{
public override string CreateSessionID(HttpContext context) => Guid.NewGuid().ToString();
public override bool Validate(string id) => Guid.TryParse(id, out _);
}
</code>
public class GuidAuthSessionIdManager : SessionIDManager
{
public override string CreateSessionID(HttpContext context) => Guid.NewGuid().ToString();
public override bool Validate(string id) => Guid.TryParse(id, out _);
}
and my config:
<code><sessionState regenerateExpiredSessionId="true"
sessionIDManagerType="WebApp.Helpers.GuidAuthSessionIdManager, WebApp" />
</code>
<code><sessionState regenerateExpiredSessionId="true"
sessionIDManagerType="WebApp.Helpers.GuidAuthSessionIdManager, WebApp" />
</code>
<sessionState regenerateExpiredSessionId="true"
sessionIDManagerType="WebApp.Helpers.GuidAuthSessionIdManager, WebApp" />
but debugger does not enter any of methods above and the cookie value still looks like mawfpkqlrsh2emx4dtuozr2l
Any ideas?
I tried all naming combinations of the type:
<code>WebApp.Helpers.GuidAuthSessionIdManager, WebApp
</code>
<code>WebApp.Helpers.GuidAuthSessionIdManager, WebApp
</code>
WebApp.Helpers.GuidAuthSessionIdManager, WebApp
<code>WebApp.Helpers.GuidAuthSessionIdManager
</code>
<code>WebApp.Helpers.GuidAuthSessionIdManager
</code>
WebApp.Helpers.GuidAuthSessionIdManager
<code>GuidAuthSessionIdManager
</code>
<code>GuidAuthSessionIdManager
</code>
GuidAuthSessionIdManager