使用window.location.assign导致Meteor.userId丢失

时间:2015-12-19 00:47:42

标签: javascript node.js meteor angular-meteor

我正在写一个Meteor站点,客户端路由由angular-meteor完成,服务器路由由IronRouter完成。其中一个调用要求在浏览器操作后,我调用服务器端路由,所以我正在使用:

window.location.assign('/my/server/route')

而不是Angular $ location.path(...)(因为此网址没有客户端路由)

我注意到如果用户已登录,则在调用window.location.assign后,Meteor.userId在服务器端变为空。

从我的日志 - 在.assign(客户端和服务器端)之前:

Meteor.userId: iaPkB6cxKGMS7b7H6

分配后(服务器端)

Meteor.userId: null

有人可以解释为什么在发生这种情况时userId会丢失吗?

0 个答案:

没有答案
相关问题