Portal password request - in progress.
This commit is contained in:
@@ -67,9 +67,9 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Controllers
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public bool DebugMode { get; } = SacsSystem.DebugMode;
|
||||
protected SbmApplication_Web App { get { return SbmApplication_Web.WebApp; } }
|
||||
public SbmSessionConfig SessionConfig { get { return App.SessionConfig; } }
|
||||
public SbmSessionContext SessionContext { get { return App.SessionContext; } }
|
||||
protected SbmApplication_Web App { get { return SbmGlobals_Web.Application; } }
|
||||
public SbmAppConfig AppConfig { get { return App.AppConfig; } }
|
||||
public SbmSessionContext SessionContext { get { return UserContext?.SessionContext ?? null; } }
|
||||
public SbmUserContext UserContext { get { return SessionData.UserContext; } }
|
||||
protected SbmLocaliser Localiser { get; }
|
||||
/// <summary>
|
||||
@@ -177,10 +177,10 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Controllers
|
||||
if (StoreSessionData)
|
||||
{
|
||||
String sessionDataJson = JsonConvert.SerializeObject(SessionData);
|
||||
HttpContext.Session.Set(SessionStorage.SessionKey_SessionConfig, SessionStorage.sessionDataEncoding.GetBytes(sessionDataJson));
|
||||
HttpContext.Session.Set(SessionStorage.SessionKey_SessionData, SessionStorage.sessionDataEncoding.GetBytes(sessionDataJson));
|
||||
}
|
||||
}
|
||||
else HttpContext.Session.Remove(SessionStorage.SessionKey_SessionConfig);
|
||||
else HttpContext.Session.Remove(SessionStorage.SessionKey_SessionData);
|
||||
|
||||
// Response headers.
|
||||
if (baseModel != null && baseModel.ProhibitCache)
|
||||
@@ -306,7 +306,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Controllers
|
||||
public class SessionStorage
|
||||
{
|
||||
public SbmSessionData_Web SessionData { get; set; }
|
||||
public static String SessionKey_SessionConfig { get; } = "SbmSessionData";
|
||||
public static String SessionKey_SessionData { get; } = "SbmSessionData";
|
||||
public static Encoding sessionDataEncoding { get; } = Encoding.UTF8;
|
||||
//JSON Serialisation.
|
||||
public class SbmSessionDataContractResolver : DefaultContractResolver
|
||||
@@ -347,7 +347,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Controllers
|
||||
if (sessionStorage.SessionData == null)
|
||||
{
|
||||
byte[] sessionDataBytes = null;
|
||||
HttpContext.Session.TryGetValue(SessionStorage.SessionKey_SessionConfig, out sessionDataBytes);
|
||||
HttpContext.Session.TryGetValue(SessionStorage.SessionKey_SessionData, out sessionDataBytes);
|
||||
if (sessionDataBytes != null)
|
||||
{
|
||||
String sessionDataJson = SessionStorage.sessionDataEncoding.GetString(sessionDataBytes);
|
||||
|
||||
Reference in New Issue
Block a user