I need to provide user (session) specific data to unauthorised users. I had a somewhat clear idea how to to it, namely by utilising Meteor’s collections mechanism and use the anonymous user’s session id as a key. But there is no obvious way to access the session id.
I googled like a maniac. Fought some time with different approaches. Wrecked my brain. Found out that the session id is available on the server, in Meteor.publish methods. Finally I came up with this mind-bending solution:[gist https://gist.github.com/Crenshinibon/6183512]
But it’s absolutely worthless. I knew this right from the beginning, but I was unable to find out the right way. The Gods of Google had left me this morning. I knew it was supposed to be stored somewhere in the client.
Right in the moment I finished and integrated the above solution, I came across the session IDs hidden place:
Update: Since Meteor 0.6.5 it is: