asp.net - SignalR cookies not sent from client -


i have cookie sent client used part of mvc web service, have integrated hub application hub doesnt sent cookie, whereas mvc app does.

now after reading other similar questions (not there many) cookies domain seems to blame, or path not set.

currently system has 2 web apps, ui , service. in dev environment so:

service http://localhost:23456/<some route>

ui http://localhost:34567/<some route>

so in above example, ui send query service, getting authorisation cookie on response, used elsewhere.

in example cookie domain service localhost, have read , seen on other questions there no need port, automatically allow ports.

are http cookies port specific?

signalr connection request not send cookies

so appear me cookie above has correct domain, , path set /, should work. doesn't send them in request javascript.

my request cors request not sure if there quirks around normal jquery ajax calls make server fine cookies, ideas?

oh cookies httponly well, not sure if makes difference...

== edit ==

have tried rule out stuff, have turned off httponly , still refuses send cookies server, have noticed few outstanding cookie issues mention adding following code in somewhere make ajax behave way:

$.ajax({                 xhrfields: {withcredentials: true}             }) 

tried using , still no luck, out of ideas.

i raised issue there underlying issue < version 2 beta of signalr relating cors , cookies.

https://github.com/signalr/signalr/issues/2318

however can manually fix issue appending:

xhrfields: {withcredentials: true}

to ajax requests within jquery.signalr-*.js, send cookies on cors, although not know if has adverse effects on older browsers or ie.


Comments