While the session ends for the user, the variables persist in memory
until the end of the session timeout. How is the server to know when
the user closed the browser? Sessions are maintained via cookies -
what that sentence in the manual means is that instead of writing a
cookie that lives when the browser is closed, the cookie is
session-based and dies when the browser closes. The same person gets a
new jsessionid and a new cookie on the next visit.

On 1/27/07, Walter Conti <[EMAIL PROTECTED]> wrote:
> I have this code in my Application.cfm that returns the number of sessions 
> and the
> number of sessions with a user loggedIn. Unfortunately the sessions do not 
> timeout
> and keep accumulating.
>
> From LiveDocs: "If you use J2EE session management, ColdFusion MX ends the 
> session and deletes all
> Session scope variables when the user closes the browser."
> How do you do this?
>
> Or maybe there is an error in my code?
>
> =================
>
> <cfapplication name="#prefix#_blog_#blogname#"
> clientManagement = "no"
> setClientCookies = "no"
> setDomainCookies = "no"
> loginStorage = "session"
> sessionManagement = "yes"
> sessionTimeout = #CreateTimeSpan(0,1,0,0)#
> applicationTimeout = #CreateTimeSpan(1,0,0,0)#>
>
> <cfscript>
> function getSessions(appName) {
> var tracker = createObject("java","coldfusion.runtime.SessionTracker");
> return tracker.getSessionCollection(appName);
> }
> </cfscript>
> <cfset structDelete(session,"nSessions","TRUE")>
> <cfset structDelete(session,"nLoggedIn","TRUE")>
> <cfset session.nSessions = 0>
> <cfset session.nLoggedIn = 0>
> <cfset sessions = getSessions(application.applicationName)>
> <cfset session.nSessions = structCount(sessions)>
> <cfloop item="s" collection="#sessions#">
> <cfif structKeyExists(sessions[s],"username")>
> <cfset session.nLoggedIn = session.nLoggedIn + 1>
> </cfif>
> </cfloop>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7 
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs 
http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:267829
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to