At 06:37 PM 2/28/01, Gary Morin wrote:
>Thanks, I was referring to having the browser running twice.
>
>My original thoughts were if the user starts up IE browser twice, to run the
>same application twice, that one browser client variables would overwrite
>the other.
This is not quite the right way to think about the issues. Client (and
session variables) don't overwrite each other when new browser windows
open. They can time-out, and be destroyed automatically, OR if the browser
somehow looses the CFID/CFTOKEN cookie, and you get a new set of empty
clean variables (a new identity, if you will). The old ones get "lost" in
the system, and are purged at timeout.
The default action by CF is to set a permanent the CFID/CFTOKEN cookie
once, the first time you visit the CF server, and never again.
>But using Session variables would keep then local to the browser.
I don't know what you mean by "local to the browser".
>So does each browser instance (not window) use the same cookie, or can you
>differentiate within it by using CFID/CFTOKEN
Yes. The CFID/CFTOKEN cookie does not change when you open a new browser
session.
Even if you did, there would be no difference between how Session and
Client vars behave in this situation.
One difference you do need to be aware of is the timeouts. Session vars
can be made to automatically timeout on a much shorter time-scale than
client vars. The timeout for Session vars can be as short as you want, and
can be set on application by application level. Client vars can only be
set to timeout as short as 2.4 hours, and this is done on the CF Admin
screen, and applies to the CF server as a whole.
Maybe this is where you are stuck, since *usually*, session variables
timeout before you open your next browser session (the default timeout is
20 min), and you get a new, fresh set of variables, whereas client vars
tend to stick around longer, days usually, so you can come back the next
day and still be logged in!
I get around this by doing my own timeouts. I check the special
Client.LastVisit variable, and if the difference between then and now is
greater than X minutes, I destroy all the client vars, and make them logon
again.
If I want them to be logged out as soon as they close their browser, I set
my own temporary cookie that gets destroyed when they close their
browser. If this cookie does not exist, destroy all the session or client
vars, and cflocate to the logon screen.
>Sorry for making you spell it out
No problem. It's a diversion from a stressful project right now :-)
================================================
Douglas M. Smith - Application Architect
TeraTech - Tools for Programmers(tm)
[EMAIL PROTECTED]
================================================
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists