asp.net - 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...
解决方案
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
您是否已设置域。
推荐阅读
- go - 如何将字段作为参数传递
- amazon-web-services - 将现有的 NBL 与 Nginx 控制器连接
- python-3.x - 尝试从 .yaml 文件安装 conda 环境时出现意外错误
- sql - Grafana:连接变量,从 sql 查询中检索
- react-native - Android软键盘取代绝对放置的组件或标题
- filepond - FilePond A11Y 问题
- sql - 从sql server中的xml中提取数据
- lua - 如何在加载到 Lua 的 C 库中进行 Lua 断点/单步调试
- javascript - 如何从移动设备上的 keydown 事件中获取密钥?
- c++ - Qt Creator vcpkg 集成