.ASPXANONYMOUS的cookie被覆盖掉上的每个新的会话 [英] .ASPXANONYMOUS cookie getting overwritten on every fresh session

查看:246
本文介绍了.ASPXANONYMOUS的cookie被覆盖掉上的每个新的会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ASP.NET 3.5的网站写在Azure之上为此我试图让双方身份验证和匿名用户配置文件。通过身份验证的轮廓很好地工作。但是,如果我没有登录,我看到在setCookie方法指令的配置文件信息发送按下 .ASPXANONYMOUS 的cookie。如果我再关闭浏览器会话并再次启动,我看到的setcookie指令从服务器发送降权了,在 .ASPXANONYMOUS 的cookie设置为一个新值:

I have an ASP.NET 3.5 site written on top of Azure for which I'm trying to allow both authenticated and anonymous user profiles. The authenticated profiles work fine. But if I am not logged in, I see the .ASPXANONYMOUS cookie sent down with the profile information in a SetCookie directive. If I then close the browser session and start up again, I see a SetCookie directive sent down from the server right away, setting the .ASPXANONYMOUS cookie to a new value:

HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/html; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNet-Version: 2.0.50727
Set-Cookie: .ASPXANONYMOUS=dTJEJCr...; expires=Fri, 12-Mar-2010 21:22:38 GMT; path=/; HttpOnly
X-Powered-By: ASP.NET
Date: Wed, 10 Feb 2010 21:22:41 GMT
Content-Length: 3146

这样的配置文件信息会话之间丢失。我不明白为什么会这样 - 我倒觉得preserving cookie值将是整点。我的的web.config 有这样:

  <!--  We allow anonymous users to have a profile using ASP.Net anonymous profiles -->
    <anonymousIdentification 
            enabled="true" 
            cookieless="UseDeviceProfile"
            cookieName=".ASPXANONYMOUS"
            cookieTimeout="43200"
            />

这是什么,我需要做的preserve跨会话cookie来允许适当的匿名型材任何想法?

Any ideas on what I need to do to preserve the cookie across sessions to allow proper anonymous profiles?

推荐答案

我认识到,9个月后,该海报可能已经移动了。我也意识到,我即将给出答案比解决方案的更多的一个变通。我也没有做任何Azure的发展,我可能是完全关闭基地;然而,悬而未决的问题来烦我 - 所以这里是我发现

I realize that after 9 months that the poster has probably moved on. I also realize that the answer I'm about to provide is more of a work-around than a solution. I also haven't done any Azure development and I could be completely off base; however, unanswered questions bug me - so here is what I've found.

如果您使用你的真实IP 而不是的127.0.0.1,您的SessionID被保留跨请求。

If you use your real IP, rather than 127.0.0.1, your SessionID is retained across requests.

这篇关于.ASPXANONYMOUS的cookie被覆盖掉上的每个新的会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆