puffpio
puffpio

Reputation: 3452

Reading a cookie from a WCF RESTful webservice

Writing a suite of IIS hosted WCF webservices (both GET and POST), and I need to be able to read a cookie for an authentication token so I know the user has been auth'd previously.

Will HttpContext.Current.Cookies give me what I need or is there something cleaner and more appropriate for a WCF web service with WebGet and WebInvoke attributes?

Upvotes: 3

Views: 3645

Answers (1)

tentonipete
tentonipete

Reputation: 5080

string cookieHeader = WebOperationContext.Current.IncomingRequest.Headers[HttpRequestHeader.Cookie];

works for me

Upvotes: 4

Related Questions