成员超时和会话超时

发布于 2024-08-13 20:35:29 字数 177 浏览 3 评论 0原文

我需要将会员超时设置为小于会话超时,以避免使用会员资格和登录会话过期,这是我在使用登录控制的 ASP.NET 应用程序中以及当用户发送评论时遇到的问题并且登录控制会话已过期,它不应该接受评论,后来我知道我必须在登录控制会话过期之前使成员资格超时过期。

那么我怎样才能让会员资格超时使b4会话过期呢?

提前致谢

I need to set memebership timeout to be less than session timeout to avoid using the membership and the login session is expired, this is a problem that i face in my asp.net application that i am using login control and when the user send a comment and the login control session is expired it should not accept the comment and i knew later that i have to make membership timeout expire before login control session expiration.

So how can i make membership timeout to expire b4 session expiration??

Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

段念尘 2024-08-20 20:35:29

您可以设置会话和身份验证 cookie 的超时:

<authentication mode="Forms">
  <forms
    loginUrl="/login.aspx"
    requireSSL="true"
    protection="All"
    timeout="15"
    domain="example.com"
    slidingExpiration="true"
    name="auth_cookie" />
</authentication>

以及会话:

<system.web>
    <sessionState 
      mode="InProc"
      cookieless="false"
      timeout="20" />
</system.web>

You could set the timeout for the session and authentication cookies:

<authentication mode="Forms">
  <forms
    loginUrl="/login.aspx"
    requireSSL="true"
    protection="All"
    timeout="15"
    domain="example.com"
    slidingExpiration="true"
    name="auth_cookie" />
</authentication>

and the session:

<system.web>
    <sessionState 
      mode="InProc"
      cookieless="false"
      timeout="20" />
</system.web>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文