public void Set(string key, string value) { CookieOptions option = new CookieOptions(); option.Expires = DateTime.Now.AddHours(3); Response.Cookies.Append(key, value, option); OperationStat.set( value.Split(new char[] { ';' })[0], "login", Request.HttpContext.Connection.RemoteIpAddress.ToString(), _environment.WebRootPath); }
private bool CheckCookie(string fr) { string cookie = _httpContextAccessor.HttpContext.Request.Cookies["manager"]; if (cookie != null) { string s = Get("manager"); string l = s.Split(new char[] { ';' })[0]; string p = s.Split(new char[] { ';' })[1]; if (Helpers.DbUser.Check(l, p)) { OperationStat.set(l, fr, Request.HttpContext.Connection.RemoteIpAddress.ToString(), _environment.WebRootPath); } return(true); } return(false); }