Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meteor: Session is not defined

I am learning meteor and following this link.

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

My code of main.js file within client folder is following

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 am doing wrong

I already read this post.

My file is inside client folder and code also inside isClient condition. Still it giving me error.

like image 279
Divyesh Savaliya Avatar asked Apr 01 '16 12:04

Divyesh Savaliya


1 Answers

The session package isn't installed by default anymore. You just need to run:

meteor add session
like image 191
David Weldon Avatar answered Oct 17 '22 12:10

David Weldon