Fiddler: catching cookie names and values

Nelson78

Well-known Member
Joined
Sep 11, 2017
Messages
526
Office Version
  1. 2007
Hello everybody.

I'm using excel vba and
VBA Code:
Set objHTTP = CreateObject("MSXML2.XMLHTTP")
to navigate a site.

This is the code:
Code:
    With objHTTP
        .Open "GET", URL, False
        .setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
        .send
        strResponse = .responseText

        Sheets(2).Range("a1") = strResponse
        
    End With

Now, I need to catch names and values concerning the 4 cookies you can see in Fiddler (I've cripted them with red lines, but I think the matter is understandable),

How can I perform the task?

Thank's in advance.

Fiddler cookies.png
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Can you share which is the response of the request, ie Sheets(2).Range("a1") content?

Bye
 
Upvote 0
Unfortunately not entirely.

This is the beginning:

VBA Code:
<meta name="viewport" content="width=device-width">

<HTML>

<HEAD>

<meta name="viewport" content="width=device-width">

It is the login page.
 
Upvote 0
Unfortunately not entirely
Unfortunately, with that level of information we cannot even be sure that the information you look for are in the response you receive from the server. I am not able to help, sorry; maybe someone else...

Bye
 
Upvote 0
Unfortunately, with that level of information we cannot even be sure that the information you look for are in the response you receive from the server. I am not able to help, sorry; maybe someone else...

Bye
Concretely, I see 4 cookies
Unfortunately, with that level of information we cannot even be sure that the information you look for are in the response you receive from the server. I am not able to help, sorry; maybe someone else...

Bye

Ok, I understand it's hard to help me, but unfortunately data are not public.

Any way, I went a little bit forward.

Maybe this is a more general issue.

I've been sending a post request:

VBA Code:
Dim LoginRequest As Object
    Set LoginRequest = CreateObject("WinHttp.WinHttpRequest.5.1")
    LoginRequest.Open "POST", "yyyyyyyyyy", False
    LoginRequest.setRequestHeader "Accept", "text/html, application/xhtml+xml, */*"
    LoginRequest.setRequestHeader "Referer", "xxxxxxxxxx"
    LoginRequest.setRequestHeader "Accept-Language", "it-IT"
    LoginRequest.setRequestHeader "User-Agent", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)"
    LoginRequest.setRequestHeader "Content-type", "application/x-www-form-urlencoded"
    LoginRequest.setRequestHeader "Connection", "Keep-Alive"
    LoginRequest.setRequestHeader "Cookie", ck1
    LoginRequest.setRequestHeader "Cookie", ck2
    LoginRequest.setRequestHeader "Cookie", ck3
    LoginRequest.send

How can I read the request I've sent, to check whether it is correct or not?
 
Upvote 0

Forum statistics

Threads
1,223,248
Messages
6,171,027
Members
452,374
Latest member
keccles

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top