CFHTTPSession.cfc Gets Request / Response Logging
Posted April 13, 2009 at 9:56 AM
I have added logging to my CFHTTPSession.cfc ColdFusion component. For those of you who don't know what CFHTTPSession.cfc is, it's a ColdFusion component that can be used to perform multiple CFHTTP requests to the same domain. The beauty behind this request wrapper is that CFHTTPSession.cfc automatically parses, stores, and re-posts any cookies that were returned in any given request. In doing so, it allows the programmer to easily maintain an actual user session across successive CFHTTP requests.
Now, when you instantiate the CFHTTPSession.cfc class, you have the option to pass in a full log file path. If you do so, then each request and each response is appended to the given TXT file. This should make debugging the request / response cycle much easier.
For more information, see my CFHTTPSession.cfc project page.
Post Comment | Ask Ben | Permalink | Other Searches | Print Page
Newer Post
What Is The Best Time Of Day To Workout?
Older Post
An Experiment In Non-Data-Type ColdFusion Components
Reader Comments
Hey Ben, I had glanced at this before but used some of my own functionality. Now in trying to refactor some code I'm giving it an actual try out. So far it is very easy to use and quite helpful.
I did find a minor bug when trying to manually set the user agent. The SetUserAgent function accepts one argument of name "Value".
However, the function refers to ARGUMENTS.UserAgent. I think that argument name is meant to be UserAgent. (Line 978).
Thanks for the awesome work you do.
@Matt,
Awesome catch. Yes that is definitely a bug.
Thanks again for your work on this, I have found this component to be wonderfully useful for something CF doesn't handle very well out of the box. It's also taught me quite a bit about how browsers interact with servers as well.
@PJ,
Glad you're liking it :)




