我更新了我的xampp,我遇到了这个错误。注意:未定义的变量:会话在中 我尝试php.ini但没有解决方案我在我的localhost中有超过30个scipts我想忽略这个错误。 我该怎么做
答案 0 :(得分:0)
将它放在php.ini
的末尾public HttpResponseMessage Post(LoginRequest loginRequest)
{
EasyParkContext context = new EasyParkContext();
User user = context.Users.SingleOrDefault(a => a.UserName == loginRequest.UserName);
if (user != null)
{
if (BCrypt.Net.BCrypt.Verify(loginRequest.Password, user.Password))
{
ClaimsIdentity claimsIdentity = new ClaimsIdentity();
claimsIdentity.AddClaim(new Claim(ClaimTypes.PrimarySid, user.Id));
claimsIdentity.AddClaim(new Claim(ClaimTypes.NameIdentifier, loginRequest.UserName));
LoginResult loginResult = new EasyParkLoginProvider(handler).CreateLoginResult(claimsIdentity, Services.Settings.MasterKey);
return this.Request.CreateResponse(HttpStatusCode.OK, loginResult);
}
}
return this.Request.CreateResponse(HttpStatusCode.Unauthorized, "Invalid username or password");
}
让那是对的php.ini