>- see footer for list info -<
Sorry,

Cant resist this one.

RE: We're running on Windows but how can the Client vars be on the users
machine? I can't see how the browser can write any kind of variable (except
a cookie) to the users machine.

What's the difference between Session and Client Scope? Is there an
Application Scope as well?

a) <obligatory RTFM> The various variable scopes are very well described in
the CF manuals, but seeing as how you obviously can't find that
info...</RTFM>

b) Application variables  are stored in server memory and persist between
the time they are created and the time that the JRun service is restarted or
they time out.
They have a persistence attribute (applicationtimeout) that gives them a
lifetime (typically 1 day).  When lifetime is finished they just disappear.
Canny developer detects this condition and refreshes them.

c) Session scope variables can be stored in various locations, could be 
in server memory, or could be in a cookie.  Location is determined by
attributes on the cfapplication tag, normally found in application.cfm at
the base of your application folder tree, or somewhere else if you run 
a framework such as fusebox.
Session variables persist for the lifetime of a browser session with the
server.
Session variables persist as long as the user fetches pages regularly from
the server.  If no pages are fetched then they time out (Typically 30
minutes).  (The browser windows is assumed to have been closed by the user)
Session vars are often destroyed during a 'logout' operation if your
application has that concept as they are often used to store user login
details (such as the fact that the user had been authenticated)
The timeout period is determined by an attribute in the cfapplication tag
(sessiontimeout).

NOTE:
Both Session and Application variables allow highly complex data structures
to be built in memory as and when required.  Some versions of CF require you
to lock the variable scope before the variable values can be read reliably,
particularly in high traffic applications.  (See Locking in the RTFM.)
Normally Session vars create a cookie that stores a couple of pointers to
the servers session variable store (these are cfid and cftoken).
The cookie does not actually store the session variable values, which are
always held in server memory.

Session variables require special consideration when your servers are
clustered due to the need to communicate variable values between the
individual servers.  Application vars might do too if individual users are
changing the application var values.

Session and client variables are private to a users browser session.
Application variables are shared between all users of the application.

d) Client variables persist forever once created unless they are destroyed.
They are Available across browser sessions.
Can be stored in registry (the default), a cookie (i.e. client browser) or
in a database.
Normal procedure when installing cold fusion is to create a database for
storing client variables because it is such a bad idea to ever consider
storing them in the registry.
When stored in a cookie, they can be destroyed by the user if they flush
their browser cache.  

Maximum and default lifetimes for application and session variables are set
in the cold fusion administrator applet.
This also allows you to set the storage location of client variables.

Cheers,.
Bryn Parrott


_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
>- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<

Reply via email to