We do have one reason for not using session vars.

Clustering.

It takes out the need to worry about the variables being held in memory.

Paul

-----Original Message-----
From: Dave Watts [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 07, 2001 7:57 AM
To: CF-Talk
Subject: RE: deleting session variables


> On first impression using client and session in the same app
> could be viable if;
>
> 1. client requires accessing client storage while session
> "stays within" the CFAS memory space.
> 2. if there are vars that need to persist after a session
> and that are useful to have readily available for a next
> session
> 3. assuming session is faster than client {1]
>
> On second impression the question needs to be answered
> whether once client are read if the values also reside
> in the CAFS memory space - if so, for how long, and
> how granular is the rentention - i.e. assuming storage is
> in a db, does one read of any client's vars cause all
> client's vars to persist in memory or is the clientmanagement
> selective to retrieving just the particular client vars
> relative to that client's current session/http request?
>
> If every reference to a client var causes a db read or write,
> then I would say that the only reason to mix client and session
> is to initialize a client session with client vars, but run the
> session with session vars.
>
> I doubt that client vars are kept in memory for a defined timeout
> period (or any other undocumented timeout period other than
> possibly applicationtimeout) like session vars so each reference
> to a client var will cause a db write or read. That has to mean
> session vars, once set, are faster.
>
> I can see an app organized so that upon logIn client vars
> in storage are used to intialize the current session, then
> these values are moved into a session layer for speed with
> any subsequent client value assignments done only for the
> purpose of preserving values that need to persist past the
> end of the current session.
>
> I would appreciate any clarification of any of this thinking.
> (above is not meant to cover clustering issues and assumes
> no design inhibitions due to ram constraints)

Client variables are kept in memory for the duration of the page request.
They're retrieved from the repository for every subsequent page request
(except when they're stored in cookies - there's no retrieval required then,
since the browser simply returns them to the server).

As for using Client variables for initialization of values, I'd argue that
you'd be better off retrieving values from a normalized database structure
(where they usually are anyway for most applications) to populate Session
variables.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to