> If you are using cookies for session variables than you CANNOT 
> use CFLOCATION. If your session variables are stored in memory, 
> go for it. The reason why you cannot set a cookie in the same 
> page is because cookie information is stored in the http headers, 
> and if the file you access says "No, no don't look here, go to 
> this page for the headers, you cookie cannot be set."

If you're using CF's session management, this isn't really much of an issue.
The session variables themselves are always stored in memory; the only thing
coming from the client are two tokens, which are used to associate the
browser with the session variables stored in memory. Those tokens can be
stored in cookies, or passed with each page request in URL variables.

> However, I don't recommend using session variables at all.  
> If you know that your site will ALWAYS be on one server and 
> never need to be clustered with multiple servers, you may use 
> them. But I ask you, how are you sure of this?
> 
> Use client storage in a database.  This is the best method 
> and for all of you at the conference that were complaining that 
> you cannot store complex data types in a database, I say this: 
> WDDX???? Hello, are you really a CF programmer?

As a warning, keep in mind that working with serialized user data within
WDDX stored in client variables will not perform nearly as well as session
variables stored in memory.

Don't make the mistake of assuming that there's always one "best" way to do
something. If you know or expect that your application will eventually be
hosted on multiple servers, then you probably don't want to use session
variables, but you'll want to remember the higher cost of client variables.
I've seen situations where people have ported from session to client
variables, and found performance to drop significantly - they had to decide
what they really needed to keep in that scope.

Also, using WDDX and client variables have another ramification - you can't
perform aggregation across users as easily or efficiently, and you're
storing denormalized data. If you're using session variables, on the other
hand, and you're storing them persistently in a normalized data schema
between session visits, you can do searches across users very efficiently.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]

Reply via email to