title: Laravel clears session data with ajax get request
body: <p>I have 2 laravel apps ,currently working on localhost</p>
  
  <ol>
  <li>askspidy  (<a href="http://localhost/askspidy/public/" rel="nofollow noreferrer">http://localhost/askspidy/public/</a>)</li>
  <li>askspidymailer (<a href="http://localhost/askspidymailer/public" rel="nofollow noreferrer">http://localhost/askspidymailer/public</a>) </li>
  </ol>
  
  <p>In askspidy app, i am using ajax get to fetch the data which is stored in askspidymailer app.</p>
  
  <p>Below is code to fetch the content written in askspidymailer into askspidy app</p>
  
  <pre><code>$.ajax({
            url: "http://localhost/askspidymailer/public/get-inbox/1",
            dataType: "json",
            type:"get",
            async: false,
            success: function(data) 
            {
              console.log(data);
              if(data!='NULL')
              {
  
                for (var i=0; i&lt;data.length; i++) 
                {
                    var fromName = data[i].fromName;
                    var fromAddress = data[i].fromAddress;
                    var subject = (data[i].subject).substr(0,50); 
                    var date = data[i].date;
  
  
                    var row = $('&lt;tr&gt;&lt;td&gt;&lt;input type=checkbox&gt;&lt;/td&gt;&lt;td class=mailbox-star&gt;&lt;a href=#&gt;&lt;i class=fa fa-star text-yellow&gt;&lt;/i&gt;&lt;/a&gt;&lt;/td&gt;&lt;td class=mailbox-name&gt;&lt;a href=# title='+ fromAddress + '&gt;' + fromName + '&lt;/a&gt;&lt;/td&gt;&lt;td class=mailbox-subject&gt;' + subject + '&lt;/td&gt;&lt;td class=mailbox-attachment&gt;&lt;i class=fa fa-paperclip&gt;&lt;/i&gt;&lt;/td&gt;&lt;td class=mailbox-date&gt;' + date + '&lt;/td&gt;&lt;/tr&gt;');
  
                    $("#inboxtable").append(row);
                }
              }
  
            }});
  </code></pre>
  
  <p>but whenever this code is executed, the askspidy laravel app session data is deleted or session id is modified , not sure </p>
  
  <p>because when i click on any other link in askspidy laravel app or refresh the current page it redirects me to login page automatically.</p>
  
  <p>I am not sure , if it's because we are connecting 2 different laravel apps or what? I have checked that if i use different url here then it works fine , but this url it somehow modifies/deletes session value </p>