Javascript 什么在吃我的饼干?!Cookie在asmx呼叫中未被转接

Javascript 什么在吃我的饼干?!Cookie在asmx呼叫中未被转接,javascript,asp.net,sharepoint,asmx,Javascript,Asp.net,Sharepoint,Asmx,我这里有一个(浏览器)cookie问题 我有一个Sharepoint页面(http://myServer:24628/sites/myApp/myDocumentLibrary/test.aspx). 当请求页面时,我可以在请求头(使用firebug)中看到ASP.NET_SessionId cookie 请求标头: 响应标题: 页面加载后,我发出asmx请求(POST): 请求标头: 在进行asmx调用之前,我提醒“ASP.NET_SessionId”cookie的值。它就在那里,它的值是正确

我这里有一个(浏览器)cookie问题

我有一个Sharepoint页面(http://myServer:24628/sites/myApp/myDocumentLibrary/test.aspx). 当请求页面时,我可以在请求头(使用firebug)中看到ASP.NET_SessionId cookie

请求标头:

响应标题:

页面加载后,我发出asmx请求(POST):

请求标头:

在进行asmx调用之前,我提醒“ASP.NET_SessionId”cookie的值。它就在那里,它的值是正确的

在notify.asmx调用中,我需要检索cookie值,以便能够运行一些逻辑。这显然是失败的。
这是怎么回事

哦,是的

  • 以下是Notify服务的url: (所以是同一个领域,对吗?)
  • 它发生在IE/FF上(没有尝试其他浏览器)
  • 在我们的生产服务器上,它工作正常
  • webservice已明确(有意)将EnableSession设置为false

Manu.

涵盖所有基础,您是否有
[WebMethod(EnableSession=true)]


这只发生在IE中吗?仅在IE中看到了这一点,必须添加一个P3P头条目,但这是针对跨域SSO解决方案的。

您的cookie不会被发送,因为两个请求的主机字段不同:

主持人:webapp01:24628

主机myServer:24628


javascript确实是从不同的位置加载的。正如Chris Lively在对我的问题的评论中所建议的那样。

@jadarnel27在我暴躁了6个小时后,你可以让我脸上露出笑容。。thx@jadarnel27-哈!我也要发同样的帖子!我以前被打败过,但不是饼干怪兽的评论@伟大的头脑TweeZz You's welcome=)调用的javascript从哪里加载?它是来自“myserver:24628”还是其他域?看看这为什么与WebMethod属性有关?似乎是浏览器没有传输cookie。那只是因为我在发布帖子之前忘记手动更改“webapp01”。。我的错,sry
Host: myServer:24628
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Cookie: ASP.NET_SessionId=2vhaxii0hxqeazii2sgw3q55; WSS_KeepSessionAuthenticated=24628
If-Modified-Since: Thu, 27 Oct 2011 15:41:15 GMT
Cache-Control: max-age=0
Cache-Control: private, max-age=0
Content-Length: 210604
Content-Type: text/html; charset=utf-8
Expires: Wed, 12 Oct 2011 15:41:24 GMT
Last-Modified: Thu, 27 Oct 2011 15:41:24 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
MicrosoftSharePointTeamServices: 12.0.0.6421
X-AspNet-Version: 2.0.50727
Set-Cookie: WSS_KeepSessionAuthenticated=24628; path=/
http%3A%2F%2FmyServer%3A24628%2Fsites%2FmyApp%2FDiscovery=WorkspaceSiteName=UG9ydGFs&WorkspaceSiteUrl=aHR0cDovL3dlYmFwcDAxOjI0NjI4L3NpdGVzL251bnRpbw==&WorkspaceSiteTime=MjAxMS0xMC0yN1QxNTo0MTozMQ==; expires=Sat, 26-Nov-2011 16:41:31 GMT; path=/_vti_bin/Discovery.asmx
Date: Thu, 27 Oct 2011 15:41:31 GMT
Host    myServer:24628
User-Agent  Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept  text/javascript, text/html, application/xml, text/xml, */*
Accept-Language en-us,en;q=0.5
Accept-Encoding gzip, deflate
Accept-Charset  ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection  keep-alive
X-Requested-With    XMLHttpRequest
X-Prototype-Version 1.7
Content-Type    application/json; charset=UTF-8
Referer http://myServer:24628/sites/myApp/myDocumentLibrary/test.aspx
Content-Length  42
Cookie  WSS_KeepSessionAuthenticated=24628