0

I have the following CFHTTP function which should return 3 cookies (XSRT-TOKEN, hl, and EASFC-WEB-SESSION) but instead only returns a JSessionID cookie.

<cfhttp url="http://www.easports.com/uk/fifa/football-club/ultimate-team" method="GET" result="stage1">
    <cfhttpparam type="header" name="Accept" value="text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" />
    <cfhttpparam type="header" name="Accept-Encoding" value="gzip, deflate" />
    <cfhttpparam type="header" name="Accept-Language" value="en-US, en;q=0.5" />
    <cfhttpparam type="header" name="Connection" value="keep-alive" />
    <cfhttpparam type="header" name="Host" value="www.easports.com" />
    <cfhttpparam type="header" name="User-Agent" value="Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36" />
</cfhttp>

Yet when I make a request to the page using an XMLHttpRequest function and look at the repsonse it has returned the 3 cookies as expected. Also when I load the URL in a browser and have a look in Fiddler the page again is returning the expected 3 cookies.

Anyone have any ideas what might be going on at all?

CPB07
  • 679
  • 3
  • 13
  • 23
  • What do you see if you `` after your `cfhttp` call? Do you see a `Set-Cookie` section in there? – Miguel-F Sep 19 '13 at 14:28
  • 1
    It is due to redirection. The first page sets some cookies and redirects to a second page, which passes the jsessionid. Disable redirection ie `redirect="no"` and you will see those three cookies in the dump. – Leigh Sep 19 '13 at 14:52
  • MiguelF - Yeah I see a Set-Cookie section but it's setting the JSessionID cookie. – CPB07 Sep 19 '13 at 15:50
  • Leigh - How do I disable redirection? Just set a header parameter with the name redirect and value of no? – CPB07 Sep 19 '13 at 15:51
  • 1
    No, it is an attribute of `cfhttp`. – Leigh Sep 19 '13 at 16:00

1 Answers1

0

Are you running Fiddler on the same server that is doing CFHTTP? On the actual web server? Also - try using userAgent param of the CFHTTP - not sending it as a separate header.

Lucas
  • 1,402
  • 1
  • 12
  • 18
  • No the page is on running on an Apache server as when I try to run it on my localhost it doesn't even return anything for some reason??? – CPB07 Sep 19 '13 at 15:00