/// <summary>get user information from the session</summary> public static TPetraPrincipal GetUserInfo() { try { object value = TSession.GetVariable("UserInfo"); if (value == null) { TLogging.Log("UserInfo is null"); return(null); } return(JsonConvert.DeserializeObject <TPetraPrincipal>(TSession.GetVariant("UserInfo").ToJson())); } catch (Exception e) { TLogging.Log("Get user info " + e.ToString()); } return(null); }