In CFMX 6.0, you will have this problem. Upgrade to 6.1 to make it work. 6.0
could not read/write to any persistant scope by design. However, this
behavior was changed in 6.1 to allow this. Another related change is that
CFCs can no longer write to the variables scope on the page they are called
from. Besides the fact that this is bad architecture, you can still fully
access the request scope instead.

If this isn't the problem, just let us know and give us more details, if you
can.

Also, thanks to CFMX's java roots, you don't need an exclusive lock around
every session variable as you did in previous versions of coldfusion.

-nathan strutz

  -----Original Message-----
  From: Merritt Chapman [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, February 10, 2004 3:18 PM
  To: CF-Talk
  Subject: Session Variables in CFCs

  Can someone give me an example of a session variable declaration within a
CFC that will persist throughout a session?

  The following code does not seem to work right.  The variable gets defined
but the value is always empty.  What am I doing wrong?

  <cflock scope="session" type="exclusive" timeout="500">
    <cfset session.myVar = "test">
  </cflock>

  I would like to have multiple CFCs that control a group of session level
IDs that determine the output in a dynamic user interface.  Is there a
better way to do this with CFCs than to use session variables?

  Thanks in advance!

  -MC
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to