1

Case:

IIS 7.5 does not handle wildcard subdomains by itself, so the work is done via DNS and IIS domain pinned directly to a specific IP adress.

Problem:

Session variables are not shared across main domain.com and sobdomain1.domain.com

Most prominent solution on the internet seemed to rely on adding the following line of code into web.config

<httpCookies domain=".domain.com" httpOnlyCookies="true" requireSSL="false" />    

However, it did not solve the problem.

Looking forward to some bright ideas. Thank you

Vega4
  • 969
  • 1
  • 11
  • 25
  • when you say it didn't solve the problem, what exactly happens? this solution seems like it would work fine and you need to make sure you are setting the cookie on both the main domain and the subdomain on every request. – Rob Allen Nov 30 '12 at 14:50
  • step 1 - while at domain.com a session variable is set through: Session["varA"] = value. step 2 - after redirecting to subdomain1.domain.com session variable varA is not set. Thank you for your comment. – Vega4 Nov 30 '12 at 14:55
  • do you see the cookie getting set on the sub domain? is it also setting the cookie domain to .domain? Have you tried setting the cookie value in code rather than web.config? Perhaps this post would help? http://stackoverflow.com/questions/7589630/sharing-asp-net-cookies-across-sub-domains – Rob Allen Nov 30 '12 at 15:30

0 Answers0