I have an ASP.NET page hosted on IIS6 running in windows 2008 server. The page has two iframes both calling to pages within the same application.
When viewed in the browser (IE8, compat mode) the session gets lost within the iFrames.
IIS is setup with a virtual directory of “App”, so the website is accessed via http://localhost/App.
The problem occurs if you type into the browser http://localhost/app – note the change of case.
As far as I was aware URLs are always case-insensitive, but in this instance it clearly in not. After some testing, it turns out that the important factor is that the URL typed into the Browser must have exactly the same casing as that of the URL on the iframe. Or at least the casing of the virtual directory between the two URLs.
So a simple fix is to make sure you always use exactly the same url casing in the browser as is used on the Virtual Directory, but this is a bit difficult with users.
I’ve thought about rewriting the URL and doing some string manipulation to make the URL of the iFrame match that of the browser, but it seems a bit hacky and potentially unreliable.
Has anyone else experienced this or is there are simply IE config I can change?
Thanks,
Urls are case sensitive. It’s IIS & ASP.NET that are not case sensitive when handling request urls, but the case sensitivity you’re seeing for cookie paths should be true for any browser you use. This is not something you’re supposed to change.
A workaround would be to redirect requests with a wrongly cased url to the correct one. You could write an IHttpModule for this, or, if you’re using IIS7, use the optional Application Request Routing module.