public string ToEncodedString() { var enc = System.Text.Encoding.UTF8; JObject sessionObject = new JObject( new JProperty("uid", Uid), new JProperty("session", SessionToken), new JProperty("session_recheck", Recheck.ToString("s")), new JProperty("group_uid", GroupUid)); return(Convert.ToBase64String(enc.GetBytes(sessionObject.ToString()))); }
/// <summary> /// Save the Maestrano session in /// HTTP Session /// </summary> public void Save() { var enc = System.Text.Encoding.UTF8; JObject sessionObject = new JObject( new JProperty("uid", Uid), new JProperty("session", SessionToken), new JProperty("session_recheck", Recheck.ToString("s")), new JProperty("group_uid", GroupUid)); // Finally store the maestrano session HttpSession[presetName] = Convert.ToBase64String(enc.GetBytes(sessionObject.ToString())); }