Meteor: session not defined

I am studying a meteorite and follow this link.

When I use Session.set , it gives me a Session is not defined error in the console

My main.js file code in the client folder is listed below

 PlayersList = new Meteor.Collection('players'); if(Meteor.isClient) { Template.leaderboard.events({ 'click .playerName ': function(){ var playerId = this._id; Session.set('selectedPlayer', playerId); } }); } 

I don't know what I'm doing wrong

I have already read this article.

My file is inside the client folder and the code is also inside the isClient condition. However, this gives me an error.

+6
source share
1 answer

The default session package is no longer installed. You just need to run:

 meteor add session 
+10
source

All Articles