> Hi. I am new to session management in CF. My application 
> inserts certain records into the database. After inserting 
> each record, the user gets to see all the records that he 
> added in this particular session.
> If the user closes browser, and adds more records, he should 
> not see the ones that he added before closing the browser.
> 
> How can i do the above. I tried it by inserting the CFID and 
> CFTOKEN into the database. But these two don't change when 
> the browser is closed. So, how can i track the records added 
> just as long as the browser is open?

You can use nonpersistent cookies to associate the CF session with the
browser. You can do this by enabling J2EE session management within the CF
Administrator if you're using CFMX, or by putting the following code within
your Application.cfm:

<cfapplication ... Setclientcookies="no">

<cfif not IsDefined("Cookie.CFID")>
        <cfcookie name="CFID" value="#Session.CFID#">
        <cfcookie name="CFTOKEN" value="#Session.CFTOKEN#">
</cfif>

If you're using CF 5 or earlier, you might want to use CFLOCK around those
CFCOOKIE tags to prevent concurrent access to the Session scope.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
http://www.cfdynamics.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:186528
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to