• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Logging in remotely with CFHTTP

New Here ,
Jun 06, 2006 Jun 06, 2006

Copy link to clipboard

Copied

I am trying to automate page downloads from an online catalog site. Unfortunately the site requires a login first. I am trying to automate the login process by submitting all the form fields via cfhttp, but apparently the site is unable to set cookies to the coldfusion browser. Below is the code i am using to access the page, but I get errors back saying my browser is not able to accept cookies. I tried changing the useragent value of the cfhttp tag but to no avail. I also tried sending the entire contents of the cookie fgile that gets put on my machine when I log in manually and sending it as a cfhttpparam type="cookie". I gave that param the same name as the text file and copied the entire contents of the file to the value attribute. still no luck. any ideas are appreciated.

thanks!
TOPICS
Advanced techniques

Views

311

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 06, 2006 Jun 06, 2006

Copy link to clipboard

Copied

It is possible, but you have to track all cookies, including those that are set between redirects, if any. This is why, you cannot use redirect="yes", but have to process redirects explicitly. There might be already [needed] cookies set by the form displaying page. Of course, you have to follow all rules for cookies, track, store, and set them, as needed. There is no such thing, as "Cold Fusion Browser" - you have to emulate a "browser" on your own.

Alternatively, you can use CFX_HTTP5 instead of CFHTTP. This tag handles those issues for you. However, it is only for Windows.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 08, 2006 Jun 08, 2006

Copy link to clipboard

Copied

LATEST
What if you also send the attributes useragent, username and password as cfhttpparams? What if you don't send any useragent information at all?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation