Comments (10)
Weird. Haven't seen that before. I need to take better look for that. Could you provide more information (logs + etc.) about this problem?
from angular-sailsjs-boilerplate.
Yes, here is the log:
error: Could not load session for socket #0HvhW7TMHXBuPcLwVKvV
error: The socket's cookie could not be parsed into a sessionID.
error: Unless you're overriding the authorization
function, make sure you pass in a valid sails.sid
cookie
error: (or omit the cookie altogether to have a new session created and an encrypted cookie sent in the response header to your socket.io upgrade request)
error: TypeError: Cannot read property 'indexOf' of undefined
at exports.parseSignedCookie (C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\node_modules\express\node_modules\connect\lib\utils.js:199:18)
at Object.Session.fromSocket (C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\lib\hooks\session\index.js:339:38)
at SocketNamespace.onConnect (C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\lib\hooks\sockets\lib\connection.js:45:18)
at SocketNamespace.EventEmitter.emit as $emit
at connect (C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\node_modules\socket.io\lib\namespace.js:292:10)
at C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\node_modules\socket.io\lib\namespace.js:308:13
at SocketNamespace.authorize (C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\node_modules\socket.io\lib\namespace.js:252:5)
at SocketNamespace.handlePacket (C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\node_modules\socket.io\lib\namespace.js:302:14)
at Manager.handleClient (C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\node_modules\socket.io\lib\manager.js:721:32)
at Manager.handleUpgrade (C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\node_modules\socket.io\lib\manager.js:641:8) { [TypeError: Cannot read property 'indexOf' of undefined]
stack: 'TypeError: Cannot read property 'indexOf' of undefined\n at exports.parseSignedCookie (C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\node_modules\express\node_modules\connect\lib\utils.js:199:18)\n at Object.Session.fro
mSocket (C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\lib\hooks\session\index.js:339:38)\n at SocketNamespace.onConnect (C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\lib\hooks\sockets\lib\connection.js:45:18)\n
at SocketNamespace.EventEmitter.emit as $emit\n at connect (C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\node_modules\socket.io\lib\namespace.js:292:10)\n at C:\Winginx\home\angular-sailsjs\backend\node
_modules\sails\node_modules\socket.io\lib\namespace.js:308:13\n at SocketNamespace.authorize (C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\node_modules\socket.io\lib\namespace.js:252:5)\n at SocketNamespace.handlePacket (C:\Wi
nginx\home\angular-sailsjs\backend\node_modules\sails\node_modules\socket.io\lib\namespace.js:302:14)\n at Manager.handleClient (C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\node_modules\socket.io\lib\manager.js:721:32)\n a
t Manager.handleUpgrade (C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\node_modules\socket.io\lib\manager.js:641:8)' }
from angular-sailsjs-boilerplate.
Aaah, some session id problem. This is something that I haven't yet figured out. This was working with previous versions of sails 0.10.x branch but not anymore.
You can avoid this, just click logout and do that login again.
from angular-sailsjs-boilerplate.
Even I clear cache, this happens again after logout, and trying to login. I faced with this problem then try to connect to server from 2 different browsers, but with different accounts (admin and demo).
from angular-sailsjs-boilerplate.
Hmm, try also to hit one of backend endpoints eg. GET /book with your browser.
from angular-sailsjs-boilerplate.
It's happening (error log) on every request to server. End I can't see no books or authors, coz server respond me with no data
from angular-sailsjs-boilerplate.
In the browser console no errors, in the browser websockets events:
5:12+::{"name":"get","args":[{"method":"get","data":{"token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.NTQzZTAyYTY1ZjgzYjJiNDEyMGZiZTJi.mJlstpX5cLZCfcK93sTc4UM28LAIgBx8UyikdFzQOhM"},"url":"http://localhost:1337/book?limit=10&populate=author&skip=0&sort=releaseDate+DESC","headers":{}}]}
in browser websockets cookies request I can see some key m with value 34e2:|47ba:t|4a01:t|77cb:t, and nothing in response
from angular-sailsjs-boilerplate.
I updated dome session specified stuff to repo. It seems like there is some cookie collision which causes this. In sails.js repo there are couple of issues like this https://github.com/balderdashy/sails/search?q=Could+not+load+session+for+socket+&type=Issues&utf8=%E2%9C%93
You can try to clear your cookies and try again, this trick work for me.
from angular-sailsjs-boilerplate.
@tarlepp - This should be fixed by my merge request, #44 - sorry, I forgot to mention it in the commit.
from angular-sailsjs-boilerplate.
@vburghelea that has been already merged. Closing this now, because no actual updates for original issue. Feel free to open this again if necessary.
from angular-sailsjs-boilerplate.
Related Issues (20)
- Bootstrap dropdown menu not showing HOT 1
- Serving production without gulp HOT 1
- DataModel handler verb 'Deleted' should be 'Destroyed' HOT 3
- Angular 2 version HOT 2
- scss-lint gem install required on Win 10 HOT 2
- Start error HOT 3
- Error in Add new Author HOT 8
- Add New Author (or Book) URL is incorrect HOT 1
- Local/Social Login + Admin users with roles HOT 5
- Error on deploying dist HOT 4
- angularSails sending __getcookie to http://localhost:1337 in production HOT 3
- AuthInterceptor and user token not passed HOT 1
- New Homepage HOT 4
- Error in Livereload HOT 2
- Error to try 'sails lift' HOT 3
- Error login outside localhost HOT 10
- Problems to enable the profile.html
- Upload files to AWS S3 HOT 1
- How to manage delete cascading HOT 5
- error in production HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-sailsjs-boilerplate.