Results 1 to 4 of 4
  1. #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.

  2. #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 08:04 PM.

  3. #3
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    517
    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.

  4. #4
    Alright, well thank you for responding and confirming.

 

 

Similar Threads

  1. Replies: 3
    Last Post: May 27th, 2019, 02:09 PM
  2. Replies: 1
    Last Post: January 19th, 2011, 11:23 AM
  3. Odd problem with cookies
    By BKnight in forum Client APIs
    Replies: 1
    Last Post: October 4th, 2010, 10:39 AM
  4. Cookies not sent to other web apps on same server
    By aakoshh in forum Client APIs
    Replies: 6
    Last Post: June 27th, 2010, 01:52 PM
  5. Multiple control.html requests
    By riwang in forum Client APIs
    Replies: 3
    Last Post: August 13th, 2009, 10:43 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 11:02 PM.