我有以下请求: 我有一个包含 2 个区域的网站
1) public - session is set for 10 minutes dynamically in code (during page request processing)
2) private - session is set for one hour dynamically in code (during page request processing)
我的问题是我有 2 个表现不同的环境:
- Development environment - reacts as expected (public and private areas have the definitions that were defined by code).
- Production environment - all areas have 15 (or 20) minutes session timeout (the timing depends on which server I define the environment).
根据描述,我了解到代码本身并不是必需的。
现在,这两个环境之间的唯一区别是生产环境具有 SSL 加密。
我需要添加什么才能使两个环境表现相同? 提前致谢。
最佳答案
检查 IIS 本身的设置。我相信默认值为 20 分钟,这可以解释为什么您会看到您所看到的内容。
Open IIS Manager and navigate to the level you want to manage. For information about opening IIS Manager, see Open IIS Manager (IIS 7).
For information about navigating to locations in the UI, see
Navigation in IIS Manager (IIS 7).In Features View, double-click ASP.
On the ASP page, under Services, expand Session Properties.
In the Time-out field, enter a time-out value in the format hh:mm:ss. For example, enter 00:15:00 for 15 minutes.
In the Actions pane, click Apply.
来自: http://technet.microsoft.com/en-us/library/cc725820(v=ws.10).aspx
关于c# - IIS 7.0 asp.net session 超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11410498/