TechnicallyChris.com

Technical and Personal Ramblings of a Bostonian
  • Home
  • About Chris
  • Donate
  • Contact Chris
Home > ColdFusion > How to Tell if CFSCHEDULE is Calling Your Page

How to Tell if CFSCHEDULE is Calling Your Page

September 22nd, 2007
Goto comments Leave a comment

For one reason or another you may need to determine logically if a page you are coding is being called by CFSCHEDULE. The way I’ve done this in the past is by examining the CGI scope for the http_user_agent. I’m not sure about older or newer versions of ColdFusion, but with CFMX 7, ColdFusion passes “CFSCHEDULE” as the value. So in your code you could do something like:

1
2
3
4
5
<cfif cgi.http_user_agent is "CFSCHEDULE">
     This page is being called by CFSCHEDULE.
<cfelse>
     This page is not being called by CFSCHEDULE.
</cfif>

Since it’s the job of the web browser (or any application requesting a web page) to pass the HTTP_USER_AGENT string, I would recommend against using this exclusively in any type of access or security function since someone could easily change their agent value to CFSCHEDULE. I’d love to hear what other ways people are doing this.

If you enjoyed this article or it helped you in any way, I’d appreciate it if you’d post a comment below to let me know. All code examples are for demonstration only and should be used at your own risk. I cannot accept liability for unexpected results.

Chris ColdFusion ColdFusion

Comments (0) Trackbacks (0) Leave a comment Trackback
  1. No comments yet.
  1. No trackbacks yet.
Subscribe to comments feed
BlueDragon 7 Dynamic Datasource Creation My Jump Into AJAX
RSS feed
  • Google
  • Youdao
  • Xian Guo
  • Zhua Xia
  • My Yahoo!
  • newsgator
  • Bloglines
  • iNezha

Sponsored By

Recent Posts

  • Just Bought the Google Nexus One
  • Seven Things I’ve Liked About Windows 7 in Seven Day
  • What’s Happened to Customer Service (Part 2)?
  • What’s Happened to Customer Service (Part 1)?
  • Capturing S.M.A.R.T. Hard Disk Data from WMI with AutoIt
  • Adjusting DCOM Settings via Script
  • How to Manually Call the Google Cache
  • RoboForm & RoboForm2Go Product Review
  • Updated PingCell Function for Excel
  • Creating Hyperlinks in Word and Excel Longer than 256 Characters

Categories

  • ColdFusion
  • Firefox
  • Google Nexus One
  • IIS
  • McAfee EE / SafeBoot
  • Microsoft Windows
  • Oracle
  • Random Code
  • Random Technology
  • Sports and Recreation
  • Subversion
  • The Untechnological

Archives

  • January 2010
  • October 2009
  • September 2009
  • August 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009
  • March 2009
  • October 2007
  • September 2007
  • August 2007
  • January 2007
  • November 2006
  • October 2006
  • September 2006
  • August 2006
  • July 2006
  • June 2006
  • May 2006

Meta

  • Register
  • Log in
PageRank
Top WordPress
Copyright © 2006-2010 TechnicallyChris.com
Theme by mg12. Valid XHTML 1.1 and CSS 3.