I have a jquery widget that get data from a server in another domain (using JsonNp). The server return data from session.
My issue happens in Safari (other browsers works). When I do a request to the server it returns data for new session each time. This happens because Session Id is stored in a cookie (but safari doesn’t allow to save 3rd party crossdomain cookies by default).
I tried changing session State from Cookieless to AutoDetected, but the Session doesn’t work with Safari.
Also I tried the following hack, but it doesn’t work for me for some reasons:
$(function(){
$('body').append('<iframe id="cookiesHackFrame" name="cookiesHackFrame" src="http://mysite.com/" style="display:none;"></iframe>');
$('body').append('<form id="cookiesHackForm" action="http://mysite.com/" method="post" target="cookiesHackFrame" >');
$('#cookiesHackForm').submit();
});
Well…Since Safary block the 3rd party crossdomain cookie…there is no way to solve…any solution would be a “break” of the security strategy…that is not likely to occurr, There are just towo ways to solve:
1) changing the browsers settings….however this is something that the user can do…not the server, so one might alert the user to change the security settings once detected the problem.
2) the 3d party server send the information to put in the cookie to the main server that in turn issues the cookie. This way crossdomain is avoided. The two servers may communicate through a web service(not very efficient…but works).