Results 1 to 10 of 13

Hybrid View

  1. #1
    Hi,

    thanks for the reply.

    I set <use_protected_js>Y</use_protected_js> and <forward_cookies>Y</forward_cookies>

    but still in the request i only see the following:

    { id: '40000014605500b77',
    verb: 'notifyUser',
    userName: null,
    userPassword: null,
    headers:
    { 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
    'cache-control': 'no-cache',
    connection: 'keep-alive',
    host: 'localhost',
    'accept-language': 'en-US,en;q=0.5',
    accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
    'content-length': '151',
    origin: 'https://localhost:4433',
    'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:29.0) Gecko/20100101 Firefox/29.0',
    'accept-encoding': 'gzip, deflate',
    referer: 'https://localhost:4433/view1',
    pragma: 'no-cache',
    REQUEST_ID: '16' } }

    Here is my notify user method:

    metadataProvider.on('notifyUser', function(request, response){

    console.log(request);

    });

    and here is the adapters config:

    <metadata_provider>
    <adapter_class>com.lightstreamer.adapters.remote.m etadata.RobustNetworkedMetadataProvider</adapter_class>
    <classloader>log-enabled</classloader>
    <param name="request_reply_port">6662</param>
    <param name="timeout">36000000</param>
    </metadata_provider>


    Is there something else that I need to do?

    Thanks for the help.

  2. #2
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Hi,

    It might depend on the browser in use; be sure to call lightstreamerClientInstance.connectionOptions.setC ookieHandlingRequired(true) on the client
    See
    http://www.lightstreamer.com/docs/cl...ndlingRequired
    and
    https://docs.google.com/a/lightstrea...rive_web#gid=1


    If still in trouble verify that the cookie is sent by the browser (check the creatre_session.js request) and get back to us.

  3. #3
    that did the trick, thanks for the help!

  4. #4
    Actually, that fixed one problem and exposed another one. I now have the required cookies, and I parse them and use the result to perform a lookup in a database which is an async call. Is it OK to call async code inside the notifyUser method? It seems that this is causing an issue currently as then I change the method body to simply:

    response.success(100000000,false);

    ... everything works just fine.

    However then I call response.success(100000000,false); from the database callback function the LSClient will no longer connect.

    What is the recommended approach here?

  5. #5
    Have looked into this further - when client.connectionOptions.setCookieHandlingRequired (true); is set by the client the request headers that are sent to the notifyUser method are different. For example:

    When client.connectionOptions.setCookieHandlingRequired is set to true:

    headers:
    { cookie: 'connect.sid=s%3A8RiLRECNKkGGSJOQnKGdGizY.iqYm2IPN gzJph7Qk%2BrG1pEqktnlm0KVLtpXEVZ5L2Yw; XSRF-TOKEN=jhIQq6AYLGxE2DrjxiK8L1zg67RfV0eaCt0N0%3D',
    connection: 'keep-alive',
    host: 'localhost',
    'accept-language': 'en-US,en;q=0.5',
    accept: '*/*',
    'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:29.0) Gecko/20100101 Firefox/29.0',
    'accept-encoding': 'gzip, deflate',
    referer: 'https://localhost:4433/view1',
    REQUEST_ID: '7' } }

    .... and when client.connectionOptions.setCookieHandlingRequired is set to false:

    headers:
    { 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
    'cache-control': 'no-cache',
    connection: 'keep-alive',
    host: 'localhost',
    'accept-language': 'en-US,en;q=0.5',
    accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
    'content-length': '147',
    origin: 'https://localhost:4433',
    'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:29.0) Gecko/20100101 Firefox/29.0',
    'accept-encoding': 'gzip, deflate',
    referer: 'https://localhost:4433/view1',
    pragma: 'no-cache',
    REQUEST_ID: '4' } }

    As we can see above the headers are different by more than just the cookie. For example when setCookieHandlingRequired is true the origin field is not specified.

    When setCookieHandlingRequired is true my LS client can't connect; I have a feeling that the problem is related to the differences mentioned above.

    Please can you advise?

    Thanks.

 

 

Similar Threads

  1. NotifyUser Header
    By milad.j in forum Adapter SDKs
    Replies: 1
    Last Post: November 4th, 2013, 09:23 AM
  2. How to get SessionId in .NET client code?
    By cwt237 in forum Client SDKs
    Replies: 6
    Last Post: September 19th, 2013, 01:05 PM
  3. Send data from DataAdapter based on user/sessionID
    By gal_nitzan in forum Adapter SDKs
    Replies: 1
    Last Post: February 12th, 2013, 09:16 PM
  4. Cookie support in android library
    By eoinoc in forum Client SDKs
    Replies: 1
    Last Post: October 15th, 2012, 09:21 AM
  5. Delay in notifyUser() causes erratic create_session behavior
    By brianjohnson in forum Adapter SDKs
    Replies: 2
    Last Post: April 5th, 2010, 12:02 PM

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 09:59 AM.