カスタムasp.net認証を実装し、ユーザーが頻繁にサインアウトしても必要なすべての属性を追加しました。
私はこのウェブサイトを共有の godaddy サーバーでホストしていました。
これが私のコードです:
var ticket = new FormsAuthenticationTicket(2, auth.Message.ToString(), DateTime.Now, DateTime.Now.AddDays(3), true,
string.Empty, FormsAuthentication.FormsCookiePath);
var cookie = new HttpCookie(FormsAuthentication.FormsCookieName, FormsAuthentication.Encrypt(ticket))
{
Domain = FormsAuthentication.CookieDomain,
Expires = DateTime.Now.AddYears(50),
HttpOnly = true,
Secure = FormsAuthentication.RequireSSL,
Path = FormsAuthentication.FormsCookiePath
};
Response.Cookies.Add(cookie);
Response.Redirect(FormsAuthentication.GetRedirectUrl(auth.Message.ToString(), true));
私の Web.config には次の値があります。
<authentication mode="Forms">
<forms requireSSL="false" timeout="120" loginUrl="~/CRM/Logon.aspx" defaultUrl="~/CRM/OTP.aspx" />
</authentication>
私のユーザーは、約 10 ~ 20 分でログオフされると不平を言っています
どんな助けでも大歓迎です。
編集
requireSSL="false" timeout="120" を削除しましたが、それでも効果はありません。
私もセッションを使用していません