【发布时间】:2011-02-01 06:41:28
【问题描述】:
我在我的 MVC 3 应用程序中使用带有 DotNetOpenAuth 的 openid-selector。每当我设置会话变量并且 DotNetOpenAuth 部分位于 web.config 中时,我的会话变量在重定向后不会粘住。
我检查了 Session.SessionID 变量,它仍然是相同的,所以我在同一个会话中(我相信),但是当我检查我刚刚在重定向后设置的会话变量时,它们都设置为 null。
我还没有看到其他人遇到这个问题。我想知道 DotNetOpenAuth 是否还没有为 MVC 3 做好准备。我也在使用最新版本的 DotNetOpenAuth。
如果有帮助,这里是 web.config 的相关部分:
<configSections>
<section name="uri" type="System.Configuration.UriSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<section name="dotNetOpenAuth" type="DotNetOpenAuth.Configuration.DotNetOpenAuthSection" requirePermission="false" allowLocation="true"/>
</configSections>
<uri>
<idn enabled="All"/>
<iriParsing enabled="true"/>
</uri>
<system.net>
<defaultProxy enabled="true"/>
<settings>
<servicePointManager checkCertificateRevocationList="true"/>
</settings>
</system.net>
<dotNetOpenAuth>
<openid>
<relyingParty>
<security requireSsl="false"/>
<behaviors>
<add type="DotNetOpenAuth.OpenId.Behaviors.AXFetchAsSregTransform, DotNetOpenAuth"/>
</behaviors>
</relyingParty>
</openid>
<messaging>
<untrustedWebRequest>
<whitelistHosts>
<add name="localhost"/>
</whitelistHosts>
</untrustedWebRequest>
</messaging>
<reporting enabled="true"/>
</dotNetOpenAuth>
更新:
它发生在我的开发服务器上,无论是在 IIS 中,还是在我运行 ASP.NET 开发服务器时。
另外,我尝试使用状态服务器在进程内和进程外运行会话,但没有任何区别。
关于新会话,我检查了 session_start 事件,但没有被调用。我还检查了 Session.IsNewSession,它也返回了 false。所以有些东西是随机的(或者可能不是那么随机)删除我的会话变量!
【问题讨论】:
标签: c# asp.net-mvc-3 dotnetopenauth