Sharing session state between 2 ASP.NET applications using SQL Server

允我心安 提交于 2019-11-28 00:03:46

It appears the issue we were having was that the session cookie domain was being being set differently on the 2 applications. This meant that each application generated it's own sessionId.

We added <httpCookies domain=".ourdomain.co.uk" /> to our web.config and that seems to have solved it. Thanks for hte help, hope this helps someone else in the future.

Persist all session data on the SQL-server, using the session-ID as key. Then use a cookie containing the session-ID that points to .mydomain.com so it will be available on both sub-domains.

This article at 15 seconds covers the subject and even shows a technique to share sessions across completely different domains.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!