public Response <BasicResponse> SetSessionData([FromBody] SessionDataToSet req) { try { lock (UserSession.CurrentSession) { LogableTask.LogSingleActivity("SetStartupData", "SetStartupData", TraceLevel.Info, $"going to save session key {req.key} as {MaskingUtil.MasKPANInString(req.value)}"); UserSession.CurrentSession.SessionData.Add(new KeyValuePair <string, string>(req.key, req.value)); LogableTask.LogSingleActivity("New SessionData", MethodBase.GetCurrentMethod(), TraceLevel.Info, JsonConvert.SerializeObject(UserSession.CurrentSession.SessionData)); } return(new Response <BasicResponse> { Success = true }); } catch (Exception ex) { LogableTask.LogSingleActivity("SetSessionData", MethodBase.GetCurrentMethod(), TraceLevel.Error, ex); return(new Response <BasicResponse> { Success = false }); } }
public void Closed() { UserSession.CurrentSession = null; LogableTask.LogSingleActivity("SessionController", MethodBase.GetCurrentMethod(), TraceLevel.Info, "Session closed"); }