Asp.net 每次我回来,我的网站都会被注销

Asp.net 每次我回来,我的网站都会被注销,asp.net,.net,cookies,asp.net-core,Asp.net,.net,Cookies,Asp.net Core,我正在开发一个asp.net core 2 web应用程序。由于某些原因,当我有一段时间(即1小时)不输入时,它将注销 这是我的web.config: <configuration> <system.webServer> <handlers> <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"

我正在开发一个asp.net core 2 web应用程序。由于某些原因,当我有一段时间(即1小时)不输入时,它将注销

这是我的web.config:

<configuration>
  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath="dotnet" arguments=".\Ojete.UI.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" />
  </system.webServer>
</configuration>

因为我不知道这是怎么发生的,所以我不知道应该发布代码的另一部分。对不起

请试试这个

services.AddAuthentication()
.Services.ConfigureApplicationCookie(options =>
{
    options.SlidingExpiration = true;
    options.ExpireTimeSpan = TimeSpan.FromMinutes(30); // here you can change timeout
});

-更多详细信息。

能否添加配置身份验证的部分?