-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Socket.IO With 'authorization' #40
Comments
@alanjames1987 that's strange. I'm using a similar setup here (cookie based auth with express) and things are working fine for me. What version of socket.io-client do you use? Do things work fine for you when testing from the browser? |
I've been using 0.9.6 as the client and server. I've been using socket.io-session to connect my Express and Socket.IO sessions. From what I can see it looks like PhoneGap just never works with cookies. I might be wrong on this but it looks like I will have to write my own authorization function to handle different requests from browsers or PhoneGap. This should be no problem, but it's just a drag that PhoneGap didn't behave exactly like browsers do. |
I'm having the same issue http://stackoverflow.com/questions/38550654/socket-io-auth-doesnt-work-on-cordova-mobile |
@eldyvoon I would suggest switching from a cookie based auth to a token based. |
In order to have Socket.IO and Express share the same session data a sessionStore and cookie have to be used. This works great on browers, but PhoneGap is giving me problems.
I referenced your Socket.IO example and the
socket.on('error'...
event keeps firing. I looked at my Socket.IO log and this is the error I am getting when PhoneGap tries to connect.I'm using PhoneGap 3.4.0 on Android 4.2.2 on a Galaxy Nexus.
Do you know how I can fix this?
The text was updated successfully, but these errors were encountered: