I haven't read the whole thread, but as you've alluded to you should never rely 
on Javascript.  Malicious or curious people can modify the variables, people 
can have Javascript turned off, close the browser, etc.

Using Javascript is fine, but you need to verify values for the redirect on the 
server.  For example, store a session variable stating when the test is due to 
end, or whatever.  Use that variable to start the timer when every page is 
generated.  Then use that variable to verify that the user's Javascript has 
correctly requested a page redirect.  You need to make sure that they haven't 
prematurely asked for a page to be redirected, and also that they haven't 
missed a Javascript redirection and are going to a page after they are supposed 
to.

You can use Ajax to update a database record as long as you verify the request 
on the server as I've mentioned.

If you verify all that on the server, then you should be fine.  I don't have 
any code for you, just suggestions ;-)

- Andrew.

On 2010-07-23, at 11:41, Dawn Sekel wrote:

> 
> I was reading this thread - but it is over 7 years old
> http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:21407#108226
> I am working on a self assessment test website in which the psychologist I'm 
> developing the site for wants to keep the end user informed of how much time 
> they have left to complete the test.  He doesn't want the session to end -- 
> just move them to the next test at the end of the time.  Obviously there are 
> lots of flaws to doing a timer on a web page -- like if the end user 
> accidently closes the browser. I received some good clues by looking at the 
> thread -- but I was wondering if anyone has a recent web page timer in 
> Coldfusion or Javascript to share that updates a database record -- or any 
> recommendations - gotcha's that they have come across.
> 
> Thanks!  Dawn 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335678
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to