我在這裏有一個(瀏覽器)cookie問題。什麼在吃我的餅乾?! Cookie不會在asmx調用中傳輸
我有一個Sharepoint頁面(http:// myServer:24628/sites/myApp/myDocumentLibrary/test.aspx)。當請求頁面時,我可以在請求頭中看到(使用螢火蟲)有一個ASP.NET_SessionId cookie。
請求頭:
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
頁面加載我做一個ASMX請求(POST)後:
請求頭:
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
就在進行asmx調用之前,我提醒'ASP.NET_SessionId'cookie的值。它在那裏,它的價值是正確的。
在notify.asmx調用中,我需要檢索cookie值以便能夠運行某些邏輯。這顯然失敗了。
這是怎麼回事?
哇啊,
- 這裏的通知服務的URL: http://myServer:24628/sites/myApp/_layouts/WebServices/NotifierServices.asmx/Notify(所以同一個域,對不對?)
- 它發生在IE/FF(沒有嘗試其他瀏覽器)
- 我們的生產服務器上它的正常工作
- web服務已明確(故意)虛假
Manu。
[可能的嫌疑犯](http://upload.wikimedia.org/wikipedia/en/5/5e/Cisforcookie.jpg)。 – jadarnel27
@ jadarnel27你可以在6個小時的脾氣暴躁後對我的臉上露出一絲笑容。thx – TweeZz
@ jadarnel27 - 哈!我打算髮布相同的!我以前一直捱打回答,但不是Cookie怪物的評論! – Curt