WCF client using several asmx services that use HTTP cookies

I am trying to use the same http cookie (actually asmx sessionid) at several endpoints of the WCF client.

The server has several endpoints, one of which is:

AuthenticationService.asmx
  Login () <- creates an HTTP cookie, which is an ASP.NET server sessionid
  Logout () <- destroys the same cookies

SomeOtherService.asmx
  DoSomeThing () <- Requires a valid cookie from AuthenticationService.asmx.

How can I share an HTTP cookie across multiple endpoints.

I have no control over the server code, and it should use WCF.

+3
source share
3

. , - WCF. , WCF API, cookie HTTP, cookie HTTP-.

, , HTTP, - , cookie HTTP-, , .

MSDN , WCF Message Inspectors.

UPDATE:

, . .

+5
0

. WCF ASP.NET, . AllowCookies BasicHttpBinding true, - cookie ASP.NET.

But I have a situation like yours where there are 2 ASP.NET services in which I need my WCF client. The first of these produces an ASP.NET identifier session cookie, and I need to pass this cookie into calls to the second service. Does anyone know how to do this?

0
source

Source: https://habr.com/ru/post/1698251/


All Articles