ブラウザーを閉じたとき、または別のユーザーがサインインしたときに、authcookie がドロップされないという問題があります。
私のクッキーはここで宣言されています:
If ModelState.IsValid Then
'check username and password
If model.pwd = db.users.First(Function(t) t.NT_id = model.NT_id).pwd Then
'create an authentication cookie
FormsAuthentication.SetAuthCookie(model.NT_id, False) 'set to false to destroy cookie on browser close
'redirect action if login is successful
Return RedirectToAction("Construction", "Home")
Else
ModelState.AddModelError("", "Invalid Username or Password")
End If
End If
Return View(model)
Cookieのユーザー名を表示する変数があるため、これがCookieをドロップしていないことはわかっています
Public Shared uNT_id = If(HttpContext.Current.User.Identity.IsAuthenticated, HttpContext.Current.User.Identity.Name, System.Environment.UserName)