I recently rebuilt our site on a Windows server (Server 2012, IIS 8.5). Had to install everything from scratch. It works 99% fine, but one issue has been bugging me, which is that it seems to create separate sessions for you when you log into www.site.com, versus site.com. DNS accepts either, and you are definitely going to the same, single site. But if you log in on www.site.com, and the for some reason type in just site.com, it acts like you are not logged in at all. It does this in all browsers. Is there some setting either in IIS or elsewhere on the server, or in Drupal, that would cause your session from either one to be recognized by the other?
The configuration in drupal has the default URL as www.site.com. The site name on the Site Information page is the same, if that has any impact. On IIS, the Site Bindings have host names of www.site.com, site.com and intranet.site.com (needed for ancient bookmarks to our old, old site that I cannot get people to update). I don't know much else about IIS, but I suspect the issue is more with Drupal than Windows, or at least how it stores such data on a Windows server.
Comments
Tell IIS to redirect naked domain to www.
The idea is to use URL Rewrites in IIS to redirect traffic to www. so your cookies will all be issued from this domain, and anyone accessing the naked domain will be redirected by IIS which adds the www. prefix.
Decent guide here: http://www.dotnetexpertguide.com/2011/08/iis-7-redirect-domaincom-to.html
Then the intranet.example.com and www.example.com checkout the awesome Domains module: https://www.drupal.org/project/domain
Or then again, multi-site is also possible depending on sharing needs between micro sites: https://www.drupal.org/documentation/install/multi-site
Thanks for posting this, it
Thanks for posting this, it worked great. I added 2 rules to basically force any request to http://*.site.com (at least whatever our DNS recognizes) to be served as https://www.site.com.