I have a very simple event configured in the \ client \ main.js file:
Template.hello.events({ 'click button': function () { Session.set('selectedPlayer', 'session value test'); Session.get('selectedPlayer'); var selectedPlayer = Session.get('selectedPlayer'); console.log(selectedPlayer); } });
However, whenever I click the button, the console says "Uncaught ReferenceError: Session is not defined" on the line with the first call to Session.set .
Other similar issues blame this on the fact that the session only works on the client, not on the server, but as far as I know, everything in the client folder is automatically on the client side.
source share