开发者

Sharing Session Cookies With Internal Domains

开发者 https://www.devze.com 2023-03-29 22:23 出处:网络
Say I have two machines in my internal network running apache: web1.mydomain.local web2.mydomain.local

Say I have two machines in my internal network running apache:

  • web1.mydomain.local
  • web2.mydomain.local

Is it possible to share a session cookie between them so logging into an application on web1 and clicking a link to web2 will pass开发者_StackOverflow社区 the session cookie over to authenticate?


Try setting the following within your web.config - this should create your cookie with a ".mydomain.local" domain, accessible from both sub-domains.

<system.web>
<httpCookies domain=".mydomain.local" httpOnlyCookies="true"/>
</system.web>

I believe this should work, but if not, you will have to some amount of session cookie alteration or session management in your code-behind.

0

精彩评论

暂无评论...
验证码 换一张
取 消