No Session Cookies on Internet Explorer 9 AJAX requests

无人久伴 提交于 2019-11-30 17:31:26

The URL I was attempting to access used an underscore character ('_'). This is an invalid URL and so Internet Explorer does not accept the cookies properly. Fixing this solved my instance of the problem.

I had this issue with IE9 for a get request. I converted from $.getJSON (using a url with query string parameters) to $.ajax (using a post). My theory would be that similar to MS's MVC server library, IE doesn't like get requests that return JSON.(you have to specifically allow this in MVC or it gives you an error indicating that get requests that return JSON have some security risk error) Anyway, since this was one of my top google hits, I figured I'd post what worked for me.

Dibakar Paul

Just put Math.random() in url like,

$.ajax({
    type: "GET",
    url: "getRequestData.do?parameter=GetModelService&t="+Math.random(),
    data: "sub=ADD",
    cache: false,
    ................
    ...............

try to avoid using localhost or 127.0.0.1 as part of your URL and see if it makes any difference.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!