We are using SocketRocket
implementing a chat feature. But the problem is when init the SocketRocket
, it filtered by the server side login filter, so it can't do http three times handshake success. When we remove the server side login filter, the SocketRocket
can success talk to server-side, but server-side can't know who is the user.
So I'm thinking whether it is the reason the SocketRocket
don't sync cookie with AFNetworking
, cause our login is using AFNetworking
library. So is there anybody know how to sync the cookies between them or if you think it is other reason, please let me know. Thanks in advance.
Here is the method we used to connect to server using SocketRocket
:
-(void)connectWebSocket{
_webSocket.delegate = nil;
_webSocket = nil;
NSString *urlString = ChatUrl;
SRWebSocket *newWebSocket = [[SRWebSocket alloc] initWithURL:[NSURL URLWithString:urlString]];
newWebSocket.delegate = self;
[newWebSocket open];
}