0

I have a strange problem that I couldn't solve, yet. I use codeiginter ajax and jquery.

I do the call from this domain http://localhost:8070/apps/views

$.ajax({
    url:'http://localhost/multicode/login/prueba',
    datatype:"json",
    crossDomain: true, 
    contentType: "application/x-www-form-urlencoded", 
    dataType: 'json', 
    processData: false, 
    cache: false, 
    success : function(r){
        console.log(r)
    }
});

Before I exec this code I create the session in this url:

http:// localhost/multicode/login/prueba

what is happen now is when I exec the ajax code I have as result null and when I exec this url (http://localhost/multicode/login/prueba) on the browser I get the sessions that I created at the begin.

jean-max
  • 1,640
  • 1
  • 18
  • 33
Franz
  • 1
  • 1

1 Answers1

1

If you will call ajax with different domain then session will not stay because session is saved on another server.

Sorav Garg
  • 1,116
  • 1
  • 9
  • 26
  • In this url http://localhost/multicode/login/ I save the session and then I call with ajax the same url http://localhost/multicode/login/ form other domain but the session is missed – Franz Jan 03 '17 at 16:42