Enable Cookies in Project for:
Startup.cs file in insert
app.UseCookiePolicy();
New a cookie create for:
CookieOptions cookie = new CookieOptions(); cookie.Expires = DateTime.Now.AddYears(10); Response.Cookies.Append("username", username, cookie); Response.Cookies.Append("password", password, cookie);
And this using cookies for:
string username = Request.Cookies["username"]; string password = Request.Cookies["password"];