Well, I finally had to create an account here. Been using this for years and have often found my answer here, but not this time. Well, I actually have found a lot of people with similar problems, but none of their solutions have helped me.
I have started on a new MVC3 project, so it's quite simple so far. I've made a handful before, so I kinda know what I'm doing (but not quite, obviously, why else be here ;-)
My problem is apparently a fairly common one: A request starts a new Session, even though the user already has one.
The most frustrating part of this is, it works perfectly on my hosted service, but is broken on localhost.
I have done a number of things to solve this:
- There is no underscore in my computer's name.
- The Session contains custom data (the error only occurs after user has logged in).
- I have added the following to web.config (hmpf, guess you'll have to assume the gt / lt chars):
httpProtocol customHeaders clear / add name="Access-Control-Allow-Origin" value="*" / /customHeaders /httpProtocol
and this too:
modules runAllManagedModulesForAllRequests="false"/
With InProc sessionstate, I have tried with 'cookieless' both true and false.
- My hosts file contains nothing about localhost.
hm. Looking at this list I'm sure I've left some out. Some on purpose too, as they were hopeless (yes, even more than the above), and born from desperation.
As mentioned this is particularly unnerving as it works on my host - could there be some configuration settings I need to tweak on the dev server (VS2010)?
I've been working from the premise that the issue is due to cross-domain security (it thinks I'm coming from another domain).
The fail happens on this request:
url: 'http://localhost:50396/moody/changeBuilding/' + elem.selectedIndex,
It's part of the options array I use with the jQuery.ajax function.
I change the domain when uploading to the host, but only the part localhost:port, everything else in the application is identical.
I've been banging my head against this for 2 days now, and will miss my exam :-( I'm determined to bury this 6 feet under, though.
I would be very grateful for any and all suggestions!
Of course, this means that my url for the options array really looks like ... the following: – Tobias Dec 12 '12 at 22:12