3

I want to host the ServiceStack authentication providers on the root of a domain (domain.com) and have the authentication work for the entire domain (sub1.domain.com, sub2.domain.com).

Is it possible to replace the default implementation of ICookies with my own so I can set domain in the cookies?

I am seeing that HttpResponseWrapper instantiates the default implementation so I am guessing no.

Is there another approach?

jeffgabhart
  • 1,117
  • 7
  • 13

1 Answers1

2

I addressed my issue with the following pull request.

In Web.config, you can specify the domain for your cookies. ServiceStack was overwriting this value, but now ServiceStack will leave it alone if it is specified.

<configuration>
  <system.web>
    <httpCookies domain=".domain.com" />
  </system.web>
</configuration>
jeffgabhart
  • 1,117
  • 7
  • 13
  • 1
    Recent versions of service stack allow you to set a domain using the endpoint host config. endpointHostConfig.RestrictAllCookiesToDomain = "domain.com"; – jeffgabhart May 06 '13 at 17:49