Is there a way for a ColdFusion app to know whether it is being run from the scheduler vs. from a browser? Ideally, I’d like to set a Session flag, for instance “isScheduled” in Application.cfm to be used throughout the app.
EDIT
I ended up checking the user agent, and that it is being run locally (to improve security), and (since it is running in Application.cfm) that the page is in the folder which allows scheduling:
Request.isScheduled = FindNoCase("CFSCHEDULE",CGI.HTTP_USER_AGENT)
and (Find("10.",CGI.REMOTE_ADDR)==1
or Find("198.162.",CGI.REMOTE_ADDR)==1)
and FindNoCase("scheduled",CGI.CF_TEMPLATE_PATH);
Check for the user agent. The user agent is “CFSCHEDULE” but please confirm this first.