-
June 23rd, 2014, 04:37 PM
#1
Client HTTP-POLLING connection/subscription requests with cookies
Our LightStreamer client connection requests must pass through a proxy which requires certain cookies to be sent. Websockets are not an option.
On page load by default, I see POST requests for create_session.js and bind_session.js to connect, and a control.js POST for a subscription. However, none of these requests pass along cookies and thus none of them get through the proxy.
I found the setCookieHandlingRequired() method in the JavaScript Client API and it ALMOST does exactly what I need. Setting this value changes the requests to GETs, parameterizes the URLs, and sends the cookies BUT only for the create_session.js and bind_session.js requests. The control.js request does not change. It fails like before and seems unchanged.
I see no similar method in the docs for the Subscription constructor to perform subscription requests with cookies. Please advise.
-
June 23rd, 2014, 07:00 PM
#2
I can manually execute a successful jQuery GET request for control.js passing all the cookies I need.
$.ajax({
url: 'https://myapp/control.js?LS_mode=RAW&LS_id=blahfooblah&....',
xhrFields: {
withCredentials: true
}
});
I know it is possible, and I know that it works. I still need help to force the Subscription request to do this automatically like the LightStreamerClient.connect() does for create_session.js and bind_session.js. How do I make the LightStreamerClient do this?
Last edited by tony99nyr; June 23rd, 2014 at 07:04 PM.
-
June 25th, 2014, 10:38 AM
#3
I confirm that with setCookieHandlingRequired(true), cookies are not sent with control requests, but only with the session creation request. The reason lies in the fact that this mechanism was initially thought to allow cookies on session creation for authentication needs. Then, subsequent requests (like subscription) already carry the session-id generated by Lightstreamer, so that cookies are no more needed.
But we acknowledge there are more and more cases where cookies are needed on every request done by the client. So, we are extending the client lib to allow such behavior.
-
June 26th, 2014, 02:03 PM
#4
Alright, well thank you for responding and confirming.
Similar Threads
-
By Kurt Grüng in forum Client SDKs
Replies: 3
Last Post: May 27th, 2019, 01:09 PM
-
By chanro4 in forum Client SDKs
Replies: 1
Last Post: January 19th, 2011, 10:23 AM
-
By BKnight in forum Client SDKs
Replies: 1
Last Post: October 4th, 2010, 09:39 AM
-
By aakoshh in forum Client SDKs
Replies: 6
Last Post: June 27th, 2010, 12:52 PM
-
By riwang in forum Client SDKs
Replies: 3
Last Post: August 13th, 2009, 09:43 AM
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 06:12 PM.
Bookmarks