Getting session ID in Meteor on startup

Mon Jun 30 2014

This way you can get the current sessions ID on the client, by calling a method on the server.

I had some problems with the Meteor.default_connection._lastSessionId returning null in Meteor.startup, so after some digging around I came up with this.

First define a method on the server.

  getSessionId: function() {

Then call on the client and wait for the response."getSessionId", function(err, id) {
  return console.log(id);