What do my cookies eat ?! Cookie not transmitted in asmx call

I have a problem with a cookie (browser).

I have a Sharepoint page (http: // myServer: 24628 / sites / myApp / myDocumentLibrary / test.aspx). When the page is requested, I can see in the request headers (using firebug) that there is an ASP.NET_SessionId cookie.

Request Headers:

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 

Answer headers:

 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 

After loading the page, I make an asmx (POST) request:

Request Headers:

 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 

Right before calling asmx, I am warning about the cookie 'ASP.NET_SessionId'. It is there and this value is correct.

In a call to notify.asmx, I need to get a cookie value in order to be able to run some logic. This obviously fails. What's going on here?

Ow yea,

Mana.

+4
source share
3 answers

javascript is really loaded from another place. As Chris Lively said in a comment on my question.

+1
source

Your cookie is not sent because the Host field does not match two requests:

Host: webapp01: 24628

Host myServer: 24628

+2
source

Covering all the databases, do you have [WebMethod(EnableSession = true)] ?

Does this only happen in IE? We saw this only with IE, I had to add a P3P header record, but this was to solve the internetwork SSO.

0
source

All Articles