> Can you give me an example how to make my own variable for my > purpose? I want to create a cookie for the current user, save > the time of the visit. Then read the cookie next time the user > visits the page. When the user leaves the page or closes the > browser, the cookie should be updated with the new visit time.
Well, this can be a little dicey. You can easily create a variable to track when a user visits a page. For example, if you want to set a Client variable when a user visits the page, just go ahead and set one on that page: <cfset Client.HomePageVisited = Now()> However, setting a variable when a user leaves a page is more difficult, because web servers don't know when you leave a page. You can use JavaScript events to trigger server-side code to run, but those depend on the browser to execute your JavaScript. The specific event handler that would interest you in this case would be the onunload event handler for the body tag. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:204564 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=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

