Hi guys
We're starting to sell Dynamicweb 9 ( 9.2.6) solutions and with that we're sometimes having issues with standard dynamicweb functionalities.
We can no longer rely on getting the current user from Dynamicweb's api (Dynamicweb.Security.UserManagement.User.GetCurrentUser()) since the Dynamicweb.Context.Current.Session sometimes (at random) can be null. The user is still there since we can get him through the regular System.Web.HttpContext:
var userSessionKey = $"{(object)"UserManagement.User.Current"}.{(object)PagePermissionLevels.Frontend}";
var user = (User)HttpContext.Current.Session[userSessionKey];
Futhermore the problem can also occur in Dynamicwebs own source code, where an exception can be thrown on a regular pageload, all because of the session being null.
[NullReferenceException]: Object reference not set to an instance of an object.
at Dynamicweb.Frontend.Devices.DeviceDetector.IsDeviceDetectionEnabled(IContext context)
at Dynamicweb.Frontend.PageView.DetectDeviceAndPlatform()
at Dynamicweb.Frontend.PageView.Load()
at Dynamicweb.Frontend.DynamicwebHttpHandler.ProcessRequest(HttpContext context)
Have anybody else experienced this issue or found a workaround untill DW corrects this somewhat critical error?
Regards
Simon Nordahl