Meteor 1.5 - Session not defined

时间:2017-06-19 14:01:37

标签: javascript node.js session meteor server

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 ?

1 个答案:

答案 0 :(得分:0)

根据Meteor文档,Session仅在客户端[https://docs.meteor.com/api/session.html]。如果您需要该功能,请查看https://github.com/matteodem/meteor-server-session但是我建议您重新考虑将应用程序调用为将会话值从客户端传递到服务器的方法。