Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am thinking about setting up a new domain to host static content on my website and have it cookieless just like Stackoverflow with their static domain. So before going ahead and buying the domain and setting it up I wanted to test it on my developement machine first under localhost (I have to mention that i am planning on having IIS running on my new domain for the static files).

I therefore created a new application under IIS and disabled session state and forms authentication. When my main application needs resources like css, images and js , I use the path to the "static" application where they are hosted.

The problem is that when I look at the request and the response for the requested files, they still have the session_id cookie defined as well as the asp.net authentication cookie.

Is it at all possible to accomplish what i am trying to do on a development machine or do i have to just go ahead and purchase the new domain which hopefully with make things right? I tried to read about cookieless domain but can't figure out what i might be missing.

share|improve this question
1  
You'll have better luck with this on stackoverflow –  Patrick R Feb 22 '10 at 23:54
    
how can i move it over there? should i just post the question over there? –  ak3naton Feb 23 '10 at 0:00
add comment

3 Answers

I setup a seperate site in iis with the cname (host: s.mysite.com, css.mysite.com and js.mysite.com)

In that site's configuration i use the following:

</system.web>
    <system.webServer>
        <staticContent>
          <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="30.00:00:00"></clientCache>
        </staticContent>
        <urlCompression doDynamicCompression="false" />
        <caching enabled="false" enableKernelCache="false">
        </caching>
    </system.webServer>
</configuration>
share|improve this answer
add comment

On IIS7/Windows 2008 you should disable session state all together for the site. That will disable cookies as well.

In the IIS Manager, select your site, under ASP.NET select Session State and choose Not Enabled.

share|improve this answer
add comment

To don't use the session state feature, put this in the web.config file:

  <configuration>
    <system.web>
      <sessionState mode="Off" />
    </system.web>
  </configuration>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.