I am trying to pass a model to action once the user logs in, but the whole model data is visible in the URL. How to hide those data from url??
Here is Sign in Code.
[HttpPost]
public ActionResult SignIn(string email, string password)
{
try
{
//Input Validation.
if (string.IsNullOrEmpty(email) || string.IsNullOrEmpty(password))
{
ViewBag.LoginState = "ERROR";
ViewBag.ErrorMessage = "PlayerID Password can not be empty.";
return View("/views/home/SignIn.cshtml");
}
if (true == ((LoginAPIController)this.APIController).AuthenticateUser(email, password))
{
Account accountDetails = ((LoginAPIController)this.APIController).GetUserDetails(email);
HedgeUtil.UserLoginToSession(accountDetails.emailAddress, accountDetails.firstName, accountDetails.lastName);
return RedirectToAction("UserPortal", "Home", accountDetails);
}
return View("/views/home/SignIn.cshtml");
}
catch
{
ViewBag.LoginState = "ERROR";
ViewBag.ErrorMessage = "Invalid UserId or Password, Please try again. Contact customer support if problem persists";
return View("/views/home/SignIn.cshtml");
}
}
Notice return RedirectToAction("UserPortal", "Home", accountDetails);
here accountDetails is model which is visible in url.
How to hide this data in url??