That worked in the fact that I see the cookie domain in Chrome dev tools is ".
mysite.dev" for both
http://mysite.dev and
http://api.mysite.dev but the session value is different between both. If the session secrets are the same for both sails apps, shouldn't the session value be identical?
Anyway, when I try to send a socket request in app.js:
// dummy request to the server, retrieves cookie. using jQuery, you can use whatever
$.get(api_url, function() {
socket.request(api_url + '/user', function (response) {
// Here's what the server responded with
console.log(response);
});
});
I get the following error:
Could not parse: No session data returned, and an error was encountered saving session data for the first time: undefined SyntaxError {} sails.io.js:141
Uncaught Error: Server response could not be parsed!
No session data returned, and an error was encountered saving session data for the first time: undefined
This worked fine before adding cookie: {domain: '.mysite.dev'} to session.js.
Maybe I'm missing something simple but haven't found the fix yet.