私はasp.net mvc 3サイトを共有ホスティングに配備しています。私の問題は、自分のサイトが5〜10分後に自動的にユーザーを自動的にログアウトすることです。ユーザーが頻繁にログアウト(デフォルトメンバーシッププロバイダ)
<forms loginUrl="~/Account.mvc/index" slidingExpiration="true" timeout="200" protection="All" />
HttpCookie authCookie = FormsAuthentication.GetAuthCookie(userName, rememberMe);
FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(authCookie.Value);
FormsAuthenticationTicket newTicket = new FormsAuthenticationTicket(1, userName, DateTime.Now, DateTime.Now.AddMinutes(200), rememberMe, CurrentUser.UserID +"|"+ CurrentUser.EmployeeID);
authCookie.Value = FormsAuthentication.Encrypt(newTicket);
Response.Cookies.Add(authCookie);
をあなたがどこにいますこの 'FormsAuthenticationTicket'を設定しますか?セッションを使っていますか? –
私は編集した質問 – Tassadaque
に示されているように、このコードを使っていますか?なぜあなたは認証クッキーを再登録していますか? –