sample rule for correlating session id

9 posts, 0 answers
  1. Srikar
    Srikar avatar
    5 posts
    Member since:
    Nov 2014

    Posted 25 Nov 2014 Link to this post

    Hi,

    Does somebody have a sample rule to capture a sessionId from a response and use it as an input in the subsequent request?

    Sorry, if this issue is already answered before. I am very new to fiddler.

    Sample could be for any standard application on the web. Like login/logout to twitter or yelp etc.

    Thanks much in advance.

    Regards,
    S
  2. Eric Lawrence
    Admin
    Eric Lawrence avatar
    833 posts

    Posted 26 Nov 2014 Link to this post

    Hello, Srikar--

    The details of such a script are highly dependent on the exact scenario in question; there's no "standard" for how session ids are transmitted or used.

    https://groups.google.com/forum/#!searchin/httpfiddler/utilissuerequest/httpfiddler/CyXSDkug_es/V3zBA0OeNjcJ provides an example of how you can issue requests from Fiddler based on any data you like. https://groups.google.com/forum/#!searchin/httpfiddler/utilissuerequest/httpfiddler/8T4ZOsOm20E/W5A_d-NEJDYJ offers some additional context.


    Regards,
    Eric Lawrence
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. Srikar
    Srikar avatar
    5 posts
    Member since:
    Nov 2014

    Posted 29 Nov 2014 in reply to Eric Lawrence Link to this post

    Hi Eric,

    Thank you much for the reply. I am going over the posts. But basically this is what I need on a very generic level:

    - capture a string from the response body, by giving left boundary and right boundary or the name of the response header value we want to capture:

    Example left boundary : <div class="gb_pa">
    Example right boundary: </div>
    The function should copy the value between these strings and saves it in a variable. - paValue

    - Now use the value in the subsequent HTTP request:

    http://<myhost>:8080/actionmode=replyPost&postId={paValue}

    Thanks,
    Srikar


  4. Eric Lawrence
    Admin
    Eric Lawrence avatar
    833 posts

    Posted 01 Dec 2014 Link to this post

    Sure, Fiddler can do this.

    Regards,
    Eric Lawrence
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  5. Srikar
    Srikar avatar
    5 posts
    Member since:
    Nov 2014

    Posted 01 Dec 2014 in reply to Eric Lawrence Link to this post

    Thanks Eric. Great to know that we can do this in fiddler.

    Do you have any sample to show how to do this?
    or what function I need to use to capture the data before the response object.
    function to save the captured value to a parameter
    and a way to give that parameter in the subsequent request

    I would really appreciate your help with this.

    Thanks,
    Srikar

  6. Eric Lawrence
    Admin
    Eric Lawrence avatar
    833 posts

    Posted 01 Dec 2014 Link to this post

    What have you tried so far?

    I can't write your code for you because you still haven't defined the problem well enough.

    How does one recognize the response for which the specified token should be sought?
    How does one recognize the request to which the specified token should be inserted?
    Is the subsequent request generated by the client application, or is the request expected to be generated by Fiddler itself?

    Eric Lawrence
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  7. Srikar
    Srikar avatar
    5 posts
    Member since:
    Nov 2014

    Posted 01 Dec 2014 in reply to Eric Lawrence Link to this post

    Hi Eric,

    I am very new to Fiddler and haven't started coding with scriptEditor yet. So far recorded a web transaction and could save it as HAR2 file and run it.

    I will break down my project in a smaller tasks and start writing code. The smaller tasks would be:

    - grabbing a text from response, when the left boundary and right boundary are specified
    - saving the text grabbed from step 1 to a variable that I can pass to a subsequent HTTP request
    - select the next immediate HTTP request that is sent via fiddler script
    - replace of value in the request URL or request header, with the variable created in step 2

    Thanks for giving the confidence that this is doable with fiddler (without recompiling the product itself etc.)

    Best Regards,
    Srikar
  8. Srikar
    Srikar avatar
    5 posts
    Member since:
    Nov 2014

    Posted 01 Dec 2014 in reply to Srikar Link to this post

    by the way, I know beforehand that the value I am looking for will come as a response to the third HTTP request that is sent by my script.

    So I need figure out how a rule will be applied to a specific response object and not to all response object in my script. And to target a specific request that is inside fiddler script for adding the variable
  9. Eric Lawrence
    Admin
    Eric Lawrence avatar
    833 posts

    Posted 02 Dec 2014 Link to this post

    http://docs.telerik.com/fiddler/KnowledgeBase/FiddlerScript/ModifyRequestOrResponse has examples that show how you can target behavior based on the URL, host, or other headers of the request.

    Regards,
    Eric Lawrence
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top