我在我的MVC 3应用程序中使用DotNetOpenAuth的openid选择器。每当我设置一个会话变量并且DotNetOpenAuth部分在web.config中时,我的会话变量在重定向之后不会粘住。我检查了Session.SessionID变量,它仍然是相同的,所以我在同一个会话中(我相信),但是当我检查会话变量后,我只是在重定向后设置它们都设置为空。DotNetOpenAuth ASP.NET MVC 3会话问题
我还没有看到任何其他人与此问题。我想知道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。所以有些东西是随机的(或者不是那么随意)删除我的会话变量!
欣赏答案,事情是,它发生在我的开发服务器上,无论是在IIS中,还是在运行ASP.NET开发服务器时。不明白发生了什么事。我删除DotNetOpenAuth一切正常。我会做更多的研究,看看会议是否正在重新启动以及导致它的原因。 – Darye 2011-02-01 15:25:24