You can use structClear(session) to kill it. The browser closing doesn't
always clear the session, as I found out in a project I work on. A common
occurrence is the browser is closed or it crashes and the user goes to log
back in and the session is still there. I have this throwing an error with
a link that runs the following script...
<cfscript>
StructClear(session);
//uncomment if using j2ee session id's//'
//getPageContext().getSession().invalidate();
</cfscript>
Eric
/*-----Original Message-----
/*From: Ian Skinner [mailto:[EMAIL PROTECTED]
/*Sent: Wednesday, March 12, 2008 8:22 AM
/*To: CF-Talk
/*Subject: Re: Closing a Session
/*
/*Gerald Guido wrote:
/*> Esteemed CFers,
/*> We have a survey and wee need to close out the session when the browser
/*> closes and when the surveu is complete. I can't remember how to do this.
/*We
/*> are using urltoken on all the forms and cflocations so we can turn off
/*> cookies if need be.
/*>
/*> A sub dropped the ball and and we need this up yesterday. Mgt is
/*freaking.
/*> So quick and dirty is perfectly acceptable at this juncture.
/*>
/*> Many, many TIA,
/*>
/*> Gerald
/*
/*
/*You Can't close the session. It will only close when the session
/*timeout expires. You can disassociate the session from the client by
/*using browser in-memory cookies for the cfid and cftoken session keys
/*that are discarded when the browser closes. Thus a user can no longer
/*access a session and must create a new one when they return. But if you
/*are counting on some code running in the onSessionEnd event to occur
/*when the browser closes, this is not going to happen.
/*
/*I believe the easiest way to use per 'session' memory cookies is to use
/*the J2EE session variables. Otherwise there is an knowledge base
/*article on how to set cfid and cftoken cookies to be memory cookies.
/*
/*
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301089
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4