我有一个ASP.NET 4网站。我已将web.Config中的身份验证超时设置为100分钟,但是当用户使用站点时,站点突然提示登录,即使3分钟后也是如此。下面的代码是我的web.Config文件
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<appSettings>
<add key="ImageMaxFileLengh" value="500" />
</appSettings>
<system.web>
<pages enableViewStateMac="false"></pages>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Speech, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
<authentication mode="Forms">
<forms defaultUrl="~/Default.aspx" loginUrl="~/Account/Login.aspx" timeout="100" name="HajLogin" slidingExpiration="true" />
</authentication>
<!--<membership>
<providers>
<clear />
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" …Run Code Online (Sandbox Code Playgroud) 我有一个 ASP.Net Core web api,它接受不记名令牌 (jwt),我在我的 Flutter 中使用 Android 模拟器发送这个令牌,此代码没有任何问题:
final response = await get(url, headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer $token',
});
Run Code Online (Sandbox Code Playgroud)
但是当我在 Chrome 浏览器中运行它时,api 响应是: 405 Method Not Allowed 。
有什么问题 ?
更新:
根据@anirudh 的评论,我在我的 web Api 中启用了 CROS 并且问题已经改变。现在的响应是:204 No Content