2

Scope:

I have been trying to simulate the request for this brazilian site and even though it "works" (I can read the correct HTML from the response), I get no "Cookies" back, when there should be at least one.

Tooling:

I am using Fiddler2 and Chrome's network tab to monitor the requests and both of them show that there are no "Cookies" returned on the response, but the "next" request my browser issues, for the "IFrame", apparently has a token that I can't find.

Request One:

GET http://www8.receita.fazenda.gov.br/SIMPLESNACIONAL/aplicacoes.aspx?id=21 HTTP/1.1
Host: www8.receita.fazenda.gov.br
Connection: keep-alive
Cache-Control: max-age=0
Accept:     text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36
Accept-Encoding: gzip, deflate, sdch
Accept-Language: pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4,es;q=0.2

Response contains no Cookies : This response did not set any cookies. This response did not contain a P3P Header.

Request Two:

GET http://www8.receita.fazenda.gov.br/SimplesNacional/Aplicacoes/ATBHE/ConsultaOptantes.app/ConsultarOpcao.aspx HTTP/1.1
Host: www8.receita.fazenda.gov.br
Connection: keep-alive
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36
Referer: http://www8.receita.fazenda.gov.br/SIMPLESNACIONAL/aplicacoes.aspx?id=21
Accept-Encoding: gzip, deflate, sdch
Accept-Language: pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4,es;q=0.2
Cookie: captcha_token=45820053240202342489914224018480902362433837860225213

Where is this "captcha_token" parameter coming from ?

What I have Tried:

1 - Manually setting this cookie. Response is still clear of cookies

2 - Reading any JavaScript code that's executed on the "page load" of the first request, but I couldn't find any code that sets the cookie for the next request

Code Sample:

Code showing no cookie returned on response

Marcello Grechi Lins
  • 3,350
  • 8
  • 38
  • 72

0 Answers0