public RequestResult <SessionTokenModel> SaveSessionToken(SessionTokenModel userSession) { string parameters = $"/applicationmandatory/savesessiontoken?sessionToken="; try { var serilizedData = JsonConvert.SerializeObject(userSession); //string parameters = $"/usersecurity/saveuserdetails?sessionToken={sessionToken}&Userdetail={serilizedData}"; return(PostAndGetData <RequestResult <SessionTokenModel> >(null, parameters, serilizedData)); } catch (Exception ex) { throw ex; } }
public RequestResult <SessionTokenModel> SaveUserSession() { SessionTokenModel model = new SessionTokenModel(); model.SessionToken1 = Guid.NewGuid().ToString().Replace("-", string.Empty); System.Web.HttpContext.Current.Session["SessionToken"] = model.SessionToken1; model.CreatedDateandTime = DateTime.Now; model.ExpiryDateandTime = DateTime.Now.AddDays(1); model.UserId = System.Web.HttpContext.Current.Session["UserId"] as string; model.id = Guid.NewGuid(); // return var sessionModel = _repository.SaveSessionToken(model); // return(sessionModel); }