user7626443
user7626443

Reputation:

Meteor 1.5 - Session not defined

I'm a PHP developer who started learning node.js and moved on to meteor, i'm trying to use Session.set("varName", "varValue"); on the server side but i get an exception "Session not defined" but when i run that command on the console on the browser or on the code on the client side it works just fine

I know this question has been asked many times i have done tons of researches before asking

-some suggested that i do : meteor add session

-others suggested that i go to .meteor/packages and add session at the last line

-others even said that it's impossible to use session on the server side, but i really need to in my project

None of these solutions worked for me and they all were about older version of meteor, and i'm using the latest version, 1.5

I'm a PHP developer so i'm used to using session in my projects and it's very annoying that i can't use it with meteor

Any ideas how i can uses session on the server side ?

Upvotes: 0

Views: 106

Answers (1)

416serg
416serg

Reputation: 448

As per Meteor docs, Session is client-side only [https://docs.meteor.com/api/session.html]. If you need that functionality, check out https://github.com/matteodem/meteor-server-session however I'd suggest rethinking your application to be calling a method that passes the session value from client to server.

Upvotes: 0

Related Questions