自动Cookie每30分钟到期一次

时间:2018-01-22 06:44:16

标签: asp.net-mvc session cookies model-view-controller

我在我的asp.net MVC 5应用程序中使用cookie而不是session。我正在加密会话值(登录用户ID)并将其保存在cookie中,并将值插入一个表中。根据我的客户端请求增加安全性(在每个请求中cookie和数据库值将检查以确保值相同)其工作正常。现在的问题是应用程序在30分钟后自动注销,我已经在IIS中将会话状态cookie超时值修改为240分钟,默认情况下为30。 我的登录代码是

<ipython-input-50-d99e0af6db20> in <module>()
1 for i in range(0, len(hyperlinks)):
2     header(hyperlinks[i])
<ipython-input-49-15ac15f9071e> in header(url)
5     soup = BeautifulSoup(page, 'lxml')
6     h = []
for head in soup.find('div',{'class':'field-item'}).find('h1'):
heading = head.get_text()
h.append(heading)
TypeError: 'NoneType' object is not iterable

此处IIS会话值已更改

IIS Cookie value

0 个答案:

没有答案