问题
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?
回答1:
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>
来源:https://stackoverflow.com/questions/13829537/servicestack-authentication-for-domain-and-subdomains