首页 > 解决方案 > Why does my ASPX app keep logging the user out?

问题描述

This ASPX app I'm working on keeps logging me out mid-session. I tried changing this:

    <sessionState mode="InProc" timeout="24" />

To

    <sessionState mode="InProc" cookieless="true" timeout="1440" />

But it still times out every couple of minutes (sometimes sooner). I've never programed in ASPX before and I'm just making basic layout changes (removing three nested tables, etc.), but it's horrible how many times I have to log in to do even the simplest things.

Any clue what else might be timing me out if not the session state? I didn't write any of this...

标签: asp.netsession-timeout

解决方案


InProc 和会话不保持日志认证。此身份验证是使用其他一些 cookie 完成的,如果您松开它,您就会退出。

有两点要看- 如果你从http到移动https,如果你从www.www.页面移动。

要解决这个问题,请web.config检查您是否正确设置了该属性(特别是domain)。

<authentication mode="Forms">
  <forms timeout="50" path="/" requireSSL="true" cookieless="UseCookies" domain="domain.com" />
</authentication>

roleManager还要检查httpCookies您是否已设置域。


推荐阅读