我们在使用 Safari(和 Opera)时遇到了问题,据我所知,FedAuth cookie 太大了。
有一个“巧妙的技巧”可以解决这个问题:
“WIF RTM 向 SessionAuthenticationModule 添加了一个属性 IsSessionMode。当翻转为 true 时,IsSessionMode 的作用是确保 SessionSecurityToken 在整个会话期间保留在缓存中,并生成一个仅包含会话标识符而不是会话标识符的 cookie。会议本身的内容。”
我在 global.asax 中有这段代码:
void WSFederationAuthenticationModule_SessionSecurityTokenCreated(object sender, Microsoft.IdentityModel.Web.SessionSecurityTokenCreatedEventArgs e)
{
FederatedAuthentication.SessionAuthenticationModule.IsSessionMode = true;
}
问题“FederatedAuthentication.SessionAuthenticationModule.IsSessionMode = true”永远不会运行......为什么?
将 IsSessionMode 设置为 true 与“PassiveSignInControl”有关吗?
MSDN 帖子 http://social.msdn.microsoft.com/Forums/en/Geneva/thread/ea00ec3f-ebdf-427c-929f-d4a196650552
your-fedauth-cookies-on-a-diet-issessionmode-true.aspx http://blogs.msdn.com/b/vbertocci/archive/2010/05/26/your-fedauth-cookies-on-a-diet-issessionmode-true.aspx
来自《Windows® Identity Foundation 编程》一书:
“SAM 的一个有趣的属性是 IsSessionMode。当设置为
true,IsSessionMode 具有存储大部分会话的效果
在服务器端令牌缓存上,而不是将所有内容写入
曲奇饼。 cookie 本身只包含一个小的上下文
标识符,它将用于检索会话
服务器。不幸的是,在这个版本的92 Part II Windows中
Identity Foundation for Identity Developers 产品没有办法
从配置文件设置 IsSessionMode。您可以通过设置它
PassiveSignInControl 的属性,或在 global.asax 文件中作为
如下(与上面相同的代码)”