【发布时间】:2014-02-02 03:00:21
【问题描述】:
我试图在sailsjs上构建套接字驱动的应用程序,它很小,我只需要内存会话适配器,但是当我重新启动应用程序时,我得到了socket.get('/'):
Could not parse: No session data returned, and an error was encountered saving session data for the first time: undefined SyntaxError {stack: (...), message: "Unexpected token N"} sails.io.js:142
Uncaught Error: Server response could not be parsed!
No session data returned, and an error was encountered saving session data for the first time: undefined
我知道我的会话已丢失,但无法找到任何方法来恢复它,甚至无法处理此错误。
有什么方法可以在不重新加载页面的情况下为套接字请求新的会话 cookie 吗?
【问题讨论】:
-
请贴出代码。
-
@JustDon't I have done:
socket.get('/');.在sailsjs 上只需sails new testapp;cd testapp;sails lift;- 在浏览器中打开http://localhost:1337,杀死应用程序(^C)运行sails lift并尝试从浏览器控制台运行socket.get('/')。
标签: javascript socket.io sails.js