put your function in a cfc and use cfschedule to call to that method. Example :
<cffunction name="callMe" access="remote">
.. do stuff here ..
Setup a scheduled task in coldfusion to call your url every X minutes :
If you have arguments, pass them in as url variables.
Write a page that does a meta-refresh to itself and stick it into an iframe of the page that needs it.
1 person found this helpful
Is there a reason why you want to keep the sessions alive indefinitely? Are you prohibited from changing the session timeouts on your hosting environment?
If so, a JS-enabled solution would be to call a remote CFC (as suggested) so that it sees activity on the current session. However, if the user does not have JS enabled on the browser and you cannot setup an AJAX call to a remote CFC, then a meta-refresh would keep the session alive, however they perform an HTTP GET which would be the same as refreshing the page (resetting/losing form values and/or interrupting user activity and position)
It's a rare requirement, but it's still a requirement.
The last time I wrote something like that is a situation where the user has to edit a some data before forwarding it on. It was a time consuming process because she has to look up the correct answer from other applications as she goes. This particular page is part of an application that has a 20 minute timeout.
Yes, As Dan suggested I wanted to keep the session alive only for one page in my application, where the user will take longer time to fill out the forms.:)
Presently i m using window.setInterval and calling a function which in turns calls .cfm page and it works fine.
Just wanted to know whether we can same kind of function in coldfusion.
CFSCHEDULE- good idea, but my customer is not preferring this one.
Thanks all for your replies.