views:

229

answers:

1

I have a Silverlight 3 control that makes a cross-domain HTTP request to http:// somedomain/. I am using the browser HTTP stack to make this request. A proper clientaccesspolicy.xml on somedomain is in place.

My browser has a set of cookies for somedomain and I want these to by used when said HTTP request is made.

When my Silverlight control is loaded from http:// localhost/, however, none of my cookies seem to be transmitted (I am using Fiddler to trace HTTP traffic)!

When I upload the xap to http:// somedomain/ though and load it from there (so that the HTTP request is not cross-domain), I see that all of my browser/IE cookies for somedomain are transmitted and everything is fine.

Is this intended behavior? I have checked MSDN and it says that browser cookies are always transmitted, regardless of whether the request is cross-domain or not.

Thanks in advance!

A: 

Actually when using the browser HTTP stack Silverlight doesn't have a great deal of control over how the cookies are handled. It leaves that up the settings the user has configured in the browser.

It might be worth you editing your HOSTS file and placing mapping your IP address to a name like "myhost.mydomain.com" (yes you can just pick what ever you like). Now visit your local site using this host name.

Under IE localhost is placed in a different zone to that of the wider internet and you may be tripping over some wierd limitations when cross from one zone to anotheer. Using a FQDN as above should place your site in the internet zone. This will at least eliminate zone issues as a source of this problem.

Another test would be use Firefox instead.

AnthonyWJones
Thanks, it seems the different zones were indeed the reason for this. With a dummy-FQDN, everything works fine.
Jo