Your code should read as follows:
CFIF IsDefined(session.ranAlready)
and dont forget to lock your session scope..
Paul
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
cfif not (structKeyExists(session, ranAlready) and
session.ranAlready)
Run Code
cfset session.ranAlready = true
/cfif
This will mean the code will only be ran once per session *not*
refresh is that what you are trying to achieve?
Probs want to lock it as well
--
dc
[Todays
need to reverse you Boolean logic
cfif NOT IsDefined(session.ranalready)
Do Stuff
cfelse
Don't do stuff
/cfif
Confidentiality Notice:This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized
:[EMAIL PROTECTED]
Sent: Friday, June 04, 2004 10:16 AM
To: CF-Talk
Subject: RE: prevent refresh w/session
cfif not (structKeyExists(session, ranAlready) and
session.ranAlready)
Run Code
cfset session.ranAlready = true
/cfif
This will mean the code will only be ran once per session
Yes. Except when I use the not after the CFIF it doesn't
display the page at all. When I leave the not in it
displays it, but when I refresh it adds data to the page and
that's what I'm trying to avoid. Am I still missing something?
I would recommend using cfparam then check for a value
5 matches
Mail list logo