RE: Deleting session variables
cfscript structdelete(session, varName); /cfscript -Original Message- From: Thane Sherrington [mailto:[EMAIL PROTECTED]] Sent: Friday, January 31, 2003 10:32 AM To: CF-Talk Subject: Deleting session variables Using CF5. I setup two session variables on one page, and on the next, I check them and then at the end of the second page, I use this code to delete them. cflock timeout=10 scope=Session type=Exclusive cfset tempvar=StructDelete(Session, MissedQuestionID) cfset tempvar=StructDelete(Session, CategoryID) /cflock But they don't get deleted. It clears the values from them, but when I put this code immediately after the delete code, it tells me they still exist. CFIF IsDefined(MissedQuestionID) MissedQuestionID Still Defined. /CFIF Is there a way to delete them completely? T ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Deleting session variables
You should check CFIF IsDefined(session.MissedQuestionID) MissedQuestionID Still Defined. /CFIF -Original Message- From: Thane Sherrington [mailto:[EMAIL PROTECTED]] Sent: vrijdag 31 januari 2003 16:32 To: CF-Talk Subject: Deleting session variables Using CF5. I setup two session variables on one page, and on the next, I check them and then at the end of the second page, I use this code to delete them. cflock timeout=10 scope=Session type=Exclusive cfset tempvar=StructDelete(Session, MissedQuestionID) cfset tempvar=StructDelete(Session, CategoryID) /cflock But they don't get deleted. It clears the values from them, but when I put this code immediately after the delete code, it tells me they still exist. CFIF IsDefined(MissedQuestionID) MissedQuestionID Still Defined. /CFIF Is there a way to delete them completely? T ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Deleting session variables
For one thing you should always scope your reference to a var. It is possible that somewhere on the page, or in the URL, or in a FORM var, you passed one with the same name as your session var. - Original Message - From: Thane Sherrington [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 31, 2003 10:32 AM Subject: Deleting session variables Using CF5. I setup two session variables on one page, and on the next, I check them and then at the end of the second page, I use this code to delete them. cflock timeout=10 scope=Session type=Exclusive cfset tempvar=StructDelete(Session, MissedQuestionID) cfset tempvar=StructDelete(Session, CategoryID) /cflock But they don't get deleted. It clears the values from them, but when I put this code immediately after the delete code, it tells me they still exist. CFIF IsDefined(MissedQuestionID) MissedQuestionID Still Defined. /CFIF Is there a way to delete them completely? T ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Deleting session variables
At 04:55 PM 01/31/03 +0100, Pascal Peters wrote: You should check CFIF IsDefined(session.MissedQuestionID) MissedQuestionID Still Defined. /CFIF Of course. How stupid of me. :) Thanks. T ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Deleting session variables
True, I do agree that you should scope everything but ColdFusion doesn't strictly enforce it so you dont have to (whos fault is that?), also with a good naming convention you really shouldn't have any naming conflicts - not a page by page level at least. -Original Message- From: WebMaster [mailto:[EMAIL PROTECTED]] Sent: 31 January 2003 16:03 To: CF-Talk Subject: Re: Deleting session variables For one thing you should always scope your reference to a var. It is possible that somewhere on the page, or in the URL, or in a FORM var, you passed one with the same name as your session var. - Original Message - From: Thane Sherrington [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 31, 2003 10:32 AM Subject: Deleting session variables Using CF5. I setup two session variables on one page, and on the next, I check them and then at the end of the second page, I use this code to delete them. cflock timeout=10 scope=Session type=Exclusive cfset tempvar=StructDelete(Session, MissedQuestionID) cfset tempvar=StructDelete(Session, CategoryID) /cflock But they don't get deleted. It clears the values from them, but when I put this code immediately after the delete code, it tells me they still exist. CFIF IsDefined(MissedQuestionID) MissedQuestionID Still Defined. /CFIF Is there a way to delete them completely? T ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Deleting session variables
To delete the session vars use cfset StructDelete(Session, VarName) Steve Burcham -Original Message- From: Thane Sherrington [mailto:[EMAIL PROTECTED]] Sent: Friday, January 31, 2003 9:32 AM To: CF-Talk Subject: Deleting session variables Using CF5. I setup two session variables on one page, and on the next, I check them and then at the end of the second page, I use this code to delete them. cflock timeout=10 scope=Session type=Exclusive cfset tempvar=StructDelete(Session, MissedQuestionID) cfset tempvar=StructDelete(Session, CategoryID) /cflock But they don't get deleted. It clears the values from them, but when I put this code immediately after the delete code, it tells me they still exist. CFIF IsDefined(MissedQuestionID) MissedQuestionID Still Defined. /CFIF Is there a way to delete them completely? T ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Deleting session variables
At 04:05 PM 01/31/03 +, Robertson-Ravo, Neil (RX) wrote: True, I do agree that you should scope everything but ColdFusion doesn't strictly enforce it so you dont have to (whos fault is that?), also with a good naming convention you really shouldn't have any naming conflicts - not a page by page level at least. Is there a good rule of thumb to follow for scoping variables? Some variables are automatically scoped, I know, but is there a way to scope regular (page) variables? T ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Deleting session variables
use the variables scope for page vars.. Clint - Original Message - From: Thane Sherrington [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 31, 2003 10:16 AM Subject: RE: Deleting session variables At 04:05 PM 01/31/03 +, Robertson-Ravo, Neil (RX) wrote: True, I do agree that you should scope everything but ColdFusion doesn't strictly enforce it so you dont have to (whos fault is that?), also with a good naming convention you really shouldn't have any naming conflicts - not a page by page level at least. Is there a good rule of thumb to follow for scoping variables? Some variables are automatically scoped, I know, but is there a way to scope regular (page) variables? T ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: deleting session variables when browser is closed
session variables are automatically deleted when the browser is closed. That is their nature. +---+ Bryan Love Macromedia Certified Professional Internet Application Developer Database Analyst Telecommunication Systems [EMAIL PROTECTED] +---+ ...'If there must be trouble, let it be in my day, that my child may have peace'... - Thomas Paine, The American Crisis -Original Message- From: Douglas Jordon [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 20, 2002 1:15 PM To: CF-Talk Subject: deleting session variables when browser is closed I seem to remember that once upon a time code was posted to delete a session variable in Application.cfm when the browser is closed. Can someone post that code? Thnx, Doug Jordon __ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: deleting session variables when browser is closed
OK. Then is there a reason why they might not? I can close all windows, relaunch the browser and there they are. Bryan Love wrote: session variables are automatically deleted when the browser is closed. That is their nature. __ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: deleting session variables when browser is closed
cfif IsDefined(Cookie.CFID) AND IsDefined(Cookie.CFTOKEN) cfset cfid_local = Cookie.CFID cfset cftoken_local = Cookie.CFTOKEN cfcookie name=CFID value=#cfid_local# cfcookie name=CFTOKEN value=#cftoken_local# /cfif -Shawn Regan -Original Message- From: Douglas Jordon [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 20, 2002 1:15 PM To: CF-Talk Subject: deleting session variables when browser is closed I seem to remember that once upon a time code was posted to delete a session variable in Application.cfm when the browser is closed. Can someone post that code? Thnx, Doug Jordon __ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: deleting session variables when browser is closed
session variables are automatically deleted when the browser is closed. That is their nature. No, they're not. The server doesn't know when the browser is closed. It only knows that some period has passed since the last request from that browser. Also, by default, the cookies created by CF are persistent, so if you open your browser, go to a site that issues CFID and CFTOKEN cookies, run some code that manipulates your session data, close your browser and then reopen it right away, your session data will be intact. If you want to disconnect a browser from the session data before the session times out, you have to ensure that the cookies aren't returned by that browser. Typically, you do this by creating session cookies, which are nonpersistent. You can do this with the CFCOOKIE tag by omitting the EXPIRES attribute: !--- all of this goes in Application.cfm --- cfapplication name=foo setclientcookies=false sessionmanagement=true .. cfif not IsDefined(Cookie.CFID) cflock scope=Session type=readonly ... cfcookie name=CFID value=#Session.CFID# cfcookie name=CFTOKEN value=#Session.CFTOKEN# /cflock /cfif Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 __ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: deleting session variables when browser is closed
My understanding of Session Vars is that they persist for whatever timeouts are specified in the Application code or in CF Admin. Mike Brunt Sempra Energy 213.244.5226 An elephant is a mouse with an operating system. -Original Message- From: Douglas Jordon [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 20, 2002 1:24 PM To: CF-Talk Subject: Re: deleting session variables when browser is closed OK. Then is there a reason why they might not? I can close all windows, relaunch the browser and there they are. Bryan Love wrote: session variables are automatically deleted when the browser is closed. That is their nature. __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: deleting session variables when browser is closed
sometimes they can linger on the server for a while before they timeout and the server destroys them (since the server has no way to know that the user has closed their browser). mike chambers [EMAIL PROTECTED] -Original Message- From: Bryan Love [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 20, 2002 4:18 PM To: CF-Talk Subject: RE: deleting session variables when browser is closed session variables are automatically deleted when the browser is closed. That is their nature. +---+ Bryan Love Macromedia Certified Professional Internet Application Developer Database Analyst Telecommunication Systems [EMAIL PROTECTED] +---+ ...'If there must be trouble, let it be in my day, that my child may have peace'... - Thomas Paine, The American Crisis -Original Message- From: Douglas Jordon [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 20, 2002 1:15 PM To: CF-Talk Subject: deleting session variables when browser is closed I seem to remember that once upon a time code was posted to delete a session variable in Application.cfm when the browser is closed. Can someone post that code? Thnx, Doug Jordon __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: deleting session variables when browser is closed
thankee kindly Shawn Regan wrote: cfif IsDefined(Cookie.CFID) AND IsDefined(Cookie.CFTOKEN) cfset cfid_local = Cookie.CFID cfset cftoken_local = Cookie.CFTOKEN cfcookie name=CFID value=#cfid_local# cfcookie name=CFTOKEN value=#cftoken_local# /cfif -Shawn Regan -Original Message- From: Douglas Jordon [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 20, 2002 1:15 PM To: CF-Talk Subject: deleting session variables when browser is closed I seem to remember that once upon a time code was posted to delete a session variable in Application.cfm when the browser is closed. Can someone post that code? Thnx, Doug Jordon __ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: RE: deleting session variables when browser is closed
Umm, no. - Original Message - From: Bryan Love [EMAIL PROTECTED] Date: Wednesday, March 20, 2002 2:17 pm Subject: RE: deleting session variables when browser is closed session variables are automatically deleted when the browser is closed.That is their nature. +---+ Bryan Love Macromedia Certified Professional Internet Application Developer Database Analyst Telecommunication Systems [EMAIL PROTECTED] +---+ ...'If there must be trouble, let it be in my day, that my child may have peace'... - Thomas Paine, The American Crisis -Original Message- From: Douglas Jordon [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 20, 2002 1:15 PM To: CF-Talk Subject: deleting session variables when browser is closed I seem to remember that once upon a time code was posted to delete a session variable in Application.cfm when the browser is closed. Can someone post that code? Thnx, Doug Jordon __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: deleting session variables when browser is closed
Very well then. In your CFapplication tag set the attribute setClientCookies to NO. That way the CFID and CFTOKEN are stored in the session struct and when the browser closes there is no persistence. I should really learn to be more explicit in my short answers. If setClientCookies is set to YES then put this just below the CFAPPLICATION tag: cfcookie name=CFID value=#cookie.cfid# cfcookie name=CFTOKEN value=#cookie.cftoken# +---+ Bryan Love Macromedia Certified Professional Internet Application Developer Database Analyst Telecommunication Systems [EMAIL PROTECTED] +---+ ...'If there must be trouble, let it be in my day, that my child may have peace'... - Thomas Paine, The American Crisis -Original Message- From: Douglas Jordon [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 20, 2002 1:33 PM To: CF-Talk Subject: Re: deleting session variables when browser is closed thankee kindly Shawn Regan wrote: cfif IsDefined(Cookie.CFID) AND IsDefined(Cookie.CFTOKEN) cfset cfid_local = Cookie.CFID cfset cftoken_local = Cookie.CFTOKEN cfcookie name=CFID value=#cfid_local# cfcookie name=CFTOKEN value=#cftoken_local# /cfif -Shawn Regan -Original Message- From: Douglas Jordon [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 20, 2002 1:15 PM To: CF-Talk Subject: deleting session variables when browser is closed I seem to remember that once upon a time code was posted to delete a session variable in Application.cfm when the browser is closed. Can someone post that code? Thnx, Doug Jordon __ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: RE: deleting session variables when browser is closed
Hmm, I don't think that's true either. Setting setclientcookies to no means that any links must have the CFID and CFTOKEN in place in order to maintain persistence. So if I go to index.cfm?cfid=1cftoken=2 and then close the browser window, my session should still be active. Therefore, if I open another browser window, I should be able to go back to index.cfm with the same cfid and cftoken, and my session should still be active, provided I go there before the session expiry date as stated in the cfapplication tag or in the administrator. - Original Message - From: Bryan Love [EMAIL PROTECTED] Date: Wednesday, March 20, 2002 3:18 pm Subject: RE: deleting session variables when browser is closed Very well then. In your CFapplication tag set the attribute setClientCookies to NO. That way the CFID and CFTOKEN are stored in the session struct and when the browser closes there is no persistence. I should really learn to be more explicit in my short answers. If setClientCookies is set to YES then put this just below the CFAPPLICATIONtag: cfcookie name=CFID value=#cookie.cfid# cfcookie name=CFTOKEN value=#cookie.cftoken# +---+ Bryan Love Macromedia Certified Professional Internet Application Developer Database Analyst Telecommunication Systems [EMAIL PROTECTED] +---+ ...'If there must be trouble, let it be in my day, that my child may have peace'... - Thomas Paine, The American Crisis -Original Message- From: Douglas Jordon [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 20, 2002 1:33 PM To: CF-Talk Subject: Re: deleting session variables when browser is closed thankee kindly Shawn Regan wrote: cfif IsDefined(Cookie.CFID) AND IsDefined(Cookie.CFTOKEN) cfset cfid_local = Cookie.CFID cfset cftoken_local = Cookie.CFTOKEN cfcookie name=CFID value=#cfid_local# cfcookie name=CFTOKEN value=#cftoken_local# /cfif -Shawn Regan -Original Message- From: Douglas Jordon [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 20, 2002 1:15 PM To: CF-Talk Subject: deleting session variables when browser is closed I seem to remember that once upon a time code was posted to delete a session variable in Application.cfm when the browser is closed. Can someone post that code? Thnx, Doug Jordon __ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: deleting session variables when browser is closed
Bryan, you're taking a beating today ;D Your post isn't correct, as was pointed out by another user. Run this sample code in its own folder, creating application.cfm and index.cfm. To test this properly you must set client management to Yes, run the file and close the browser *immediately*. Then set client mgmt off and comment out the cookie stuff. This will flush out cfid and cftoken from your 127.0.0.1 cookie and kill cf server's ability to figure out who you are. Your example would work on a dev server whose 127.0.0.1 cfid and cftoken cookies are long-since instantiated regardless of whether or not you enable client management on your current app. Once you flush the cookies you'll see that state isn't maintained unless you use the second link in the example file. --- Matt Robertson[EMAIL PROTECTED] MSB Designs, Inc., www.mysecretbase.com --- CFAPPLICATION NAME=MYTEST_X SESSIONMANAGEMENT=yes CLIENTMANAGEMENT=no SETCLIENTCOOKIES=No !--- cfcookie name=CFID value=#cookie.cfid# cfcookie name=CFTOKEN value=#cookie.cftoken# --- CFIF isdefined (url.action) CFLOCK SCOPE=SESSION TYPE=EXCLUSIVE TIMEOUT=10 CFSET session.myvar=SESSION VAR INSTANTIATED /CFLOCK /CFIF htmlheadtitle/title/headbody click this A HREF=index.cfmlink/AP CFOUTPUT CFLOCK SCOPE=SESSION TYPE=READONLY TIMEOUT=10 Now click A HREF=index.cfm?CFID=#session.cfid#cftoken=#session.cftoken#this one/AP #session.CFID# and #session.cftoken#P Click A HREF=index.cfm?action=1here/A to set a session variableP CFIF isdefined (session.myvar) #session.myvar# /CFIF /CFLOCK /CFOUTPUT /body/html -- Original Message -- from: Bryan Love [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] date: Wed, 20 Mar 2002 14:18:48 -0800 Very well then. In your CFapplication tag set the attribute setClientCookies to NO. That way the CFID and CFTOKEN are stored in the session struct and when the browser closes there is no persistence. I should really learn to be more explicit in my short answers. If setClientCookies is set to YES then put this just below the CFAPPLICATION tag: cfcookie name=CFID value=#cookie.cfid# cfcookie name=CFTOKEN value=#cookie.cftoken# +---+ Bryan Love Macromedia Certified Professional Internet Application Developer Database Analyst Telecommunication Systems [EMAIL PROTECTED] +---+ ...'If there must be trouble, let it be in my day, that my child may have peace'... - Thomas Paine, The American Crisis -Original Message- From: Douglas Jordon [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 20, 2002 1:33 PM To: CF-Talk Subject: Re: deleting session variables when browser is closed thankee kindly Shawn Regan wrote: cfif IsDefined(Cookie.CFID) AND IsDefined(Cookie.CFTOKEN) cfset cfid_local = Cookie.CFID cfset cftoken_local = Cookie.CFTOKEN cfcookie name=CFID value=#cfid_local# cfcookie name=CFTOKEN value=#cftoken_local# /cfif -Shawn Regan -Original Message- From: Douglas Jordon [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 20, 2002 1:15 PM To: CF-Talk Subject: deleting session variables when browser is closed I seem to remember that once upon a time code was posted to delete a session variable in Application.cfm when the browser is closed. Can someone post that code? Thnx, Doug Jordon __ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: RE: deleting session variables when browser is closed
Partly true on closer inspection. You are correct in that you must pass the variables through the url string - I was mistaken in thinking that the session would persist without doing that. The cfid and cftoken are stored in the session struct however (but I don't know what they are doing there...). I must admit I haven't used session variables for years and some of my previous assumptions that I thought were true are faulty. Thanks for straightening me out! +---+ Bryan Love Macromedia Certified Professional Internet Application Developer Database Analyst Telecommunication Systems [EMAIL PROTECTED] +---+ ...'If there must be trouble, let it be in my day, that my child may have peace'... - Thomas Paine, The American Crisis -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 20, 2002 2:41 PM To: CF-Talk Subject: Re: RE: deleting session variables when browser is closed Hmm, I don't think that's true either. Setting setclientcookies to no means that any links must have the CFID and CFTOKEN in place in order to maintain persistence. So if I go to index.cfm?cfid=1cftoken=2 and then close the browser window, my session should still be active. Therefore, if I open another browser window, I should be able to go back to index.cfm with the same cfid and cftoken, and my session should still be active, provided I go there before the session expiry date as stated in the cfapplication tag or in the administrator. - Original Message - From: Bryan Love [EMAIL PROTECTED] Date: Wednesday, March 20, 2002 3:18 pm Subject: RE: deleting session variables when browser is closed Very well then. In your CFapplication tag set the attribute setClientCookies to NO. That way the CFID and CFTOKEN are stored in the session struct and when the browser closes there is no persistence. I should really learn to be more explicit in my short answers. If setClientCookies is set to YES then put this just below the CFAPPLICATIONtag: cfcookie name=CFID value=#cookie.cfid# cfcookie name=CFTOKEN value=#cookie.cftoken# +---+ Bryan Love Macromedia Certified Professional Internet Application Developer Database Analyst Telecommunication Systems [EMAIL PROTECTED] +---+ ...'If there must be trouble, let it be in my day, that my child may have peace'... - Thomas Paine, The American Crisis -Original Message- From: Douglas Jordon [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 20, 2002 1:33 PM To: CF-Talk Subject: Re: deleting session variables when browser is closed thankee kindly Shawn Regan wrote: cfif IsDefined(Cookie.CFID) AND IsDefined(Cookie.CFTOKEN) cfset cfid_local = Cookie.CFID cfset cftoken_local = Cookie.CFTOKEN cfcookie name=CFID value=#cfid_local# cfcookie name=CFTOKEN value=#cftoken_local# /cfif -Shawn Regan -Original Message- From: Douglas Jordon [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 20, 2002 1:15 PM To: CF-Talk Subject: deleting session variables when browser is closed I seem to remember that once upon a time code was posted to delete a session variable in Application.cfm when the browser is closed. Can someone post that code? Thnx, Doug Jordon __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: deleting session variables when browser is closed
In your CFapplication tag set the attribute setClientCookies to NO. That way the CFID and CFTOKEN are stored in the session struct and when the browser closes there is no persistence. I should really learn to be more explicit in my short answers. If setClientCookies is set to YES then put this just below the CFAPPLICATION tag: cfcookie name=CFID value=#cookie.cfid# cfcookie name=CFTOKEN value=#cookie.cftoken# Unfortunately, it's not as simple as that. For Session variables to work, they have to be stored in memory on the CF Server, along with the CFID and CFTOKEN identifiers, and the browser has to send those identifiers back to the server on each subsequent request. So, if you set SETCLIENTCOOKIES to no or false, you'll have to ensure that CFID and CFTOKEN get returned via URL or form variables. Also, on the server, there's no way to tell when the browser has closed. All the server can do is tell that the browser hasn't requested a page since some specific time. So, no matter what you do, in a regular HTML-based interface, the Session variables will persist for some time after the browser has been closed. The best you can usually do is to disconnect the browser from those variables, by not storing the CFID and CFTOKEN values as persistent cookies. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: RE: deleting session variables when browser is closed
The cfid and cftoken are stored in the session struct however (but I don't know what they are doing there...). CF has to store the CFID and CFTOKEN values, and compare them against those received from the browser to determine if those are your session variables. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 __ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: RE: deleting session variables when browser is closed
CFIF IsDefined(Client.CFTOKEN) OR IsDefined(Client.CFID) CFSET DeleteClientVariable(CFTOKEN) CFSET DeleteClientVariable(CFID) /CFIF CFIF IsDefined(Session.CFTOKEN) OR IsDefined(Session.CFID) CFSET StructDelete(Session, CFTOKEN) CFSET StructDelete(Session, CFID) /CFIF CFIF IsDefined(Cookie.CFTOKEN) OR IsDefined(Cookie.CFID) CFCOOKIE NAME=CFTOKEN EXPIRES=NOW CFCOOKIE NAME=CFID EXPIRES=NOW /CFIF Success is a journey, not a destination!! Doug Brown - Original Message - From: Dave Watts [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Wednesday, March 20, 2002 4:23 PM Subject: RE: RE: deleting session variables when browser is closed The cfid and cftoken are stored in the session struct however (but I don't know what they are doing there...). CF has to store the CFID and CFTOKEN values, and compare them against those received from the browser to determine if those are your session variables. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 __ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: RE: deleting session variables when browser is closed
Ah yes... that makes perfect sense. +---+ Bryan Love Macromedia Certified Professional Internet Application Developer Database Analyst Telecommunication Systems [EMAIL PROTECTED] +---+ ...'If there must be trouble, let it be in my day, that my child may have peace'... - Thomas Paine, The American Crisis -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 20, 2002 4:24 PM To: CF-Talk Subject: RE: RE: deleting session variables when browser is closed The cfid and cftoken are stored in the session struct however (but I don't know what they are doing there...). CF has to store the CFID and CFTOKEN values, and compare them against those received from the browser to determine if those are your session variables. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: deleting session variables
We do have one reason for not using session vars. Clustering. It takes out the need to worry about the variables being held in memory. Paul -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED]] Sent: Sunday, January 07, 2001 7:57 AM To: CF-Talk Subject: RE: deleting session variables On first impression using client and session in the same app could be viable if; 1. client requires accessing client storage while session "stays within" the CFAS memory space. 2. if there are vars that need to persist after a session and that are useful to have readily available for a next session 3. assuming session is faster than client {1] On second impression the question needs to be answered whether once client are read if the values also reside in the CAFS memory space - if so, for how long, and how granular is the rentention - i.e. assuming storage is in a db, does one read of any client's vars cause all client's vars to persist in memory or is the clientmanagement selective to retrieving just the particular client vars relative to that client's current session/http request? If every reference to a client var causes a db read or write, then I would say that the only reason to mix client and session is to initialize a client session with client vars, but run the session with session vars. I doubt that client vars are kept in memory for a defined timeout period (or any other undocumented timeout period other than possibly applicationtimeout) like session vars so each reference to a client var will cause a db write or read. That has to mean session vars, once set, are faster. I can see an app organized so that upon logIn client vars in storage are used to intialize the current session, then these values are moved into a session layer for speed with any subsequent client value assignments done only for the purpose of preserving values that need to persist past the end of the current session. I would appreciate any clarification of any of this thinking. (above is not meant to cover clustering issues and assumes no design inhibitions due to ram constraints) Client variables are kept in memory for the duration of the page request. They're retrieved from the repository for every subsequent page request (except when they're stored in cookies - there's no retrieval required then, since the browser simply returns them to the server). As for using Client variables for initialization of values, I'd argue that you'd be better off retrieving values from a normalized database structure (where they usually are anyway for most applications) to populate Session variables. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: deleting session variables
On first impression using client and session in the same app could be viable if; 1. client requires accessing client storage while session "stays within" the CFAS memory space. 2. if there are vars that need to persist after a session and that are useful to have readily available for a next session 3. assuming session is faster than client {1] On second impression the question needs to be answered whether once client are read if the values also reside in the CAFS memory space - if so, for how long, and how granular is the rentention - i.e. assuming storage is in a db, does one read of any client's vars cause all client's vars to persist in memory or is the clientmanagement selective to retrieving just the particular client vars relative to that client's current session/http request? If every reference to a client var causes a db read or write, then I would say that the only reason to mix client and session is to initialize a client session with client vars, but run the session with session vars. I doubt that client vars are kept in memory for a defined timeout period (or any other undocumented timeout period other than possibly applicationtimeout) like session vars so each reference to a client var will cause a db write or read. That has to mean session vars, once set, are faster. I can see an app organized so that upon logIn client vars in storage are used to intialize the current session, then these values are moved into a session layer for speed with any subsequent client value assignments done only for the purpose of preserving values that need to persist past the end of the current session. I would appreciate any clarification of any of this thinking. (above is not meant to cover clustering issues and assumes no design inhibitions due to ram constraints) Client variables are kept in memory for the duration of the page request. They're retrieved from the repository for every subsequent page request (except when they're stored in cookies - there's no retrieval required then, since the browser simply returns them to the server). As for using Client variables for initialization of values, I'd argue that you'd be better off retrieving values from a normalized database structure (where they usually are anyway for most applications) to populate Session variables. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: deleting session variables
I am using this code to delete my session variables when a user closes their browser: cfif IsDefined("Cookie.CFID") AND IsDefined("Cookie.CFTOKEN") cfset cfid_local = Cookie.CFID cfset cftoken_local = Cookie.CFTOKEN cfcookie name="CFID" value="#cfid_local#" cfcookie name="CFTOKEN" value="#cftoken_local#" /cfif The only problem is that it also deletes my client variables upon closing the browser. Is there any way to just delete session variables and leave the client intact?? Actually, this code doesn't delete Session or Client variables. What it does delete is the link between an individual browser and the variables on the server. Client and Session variables are associated with a specific browser via those two cookies (assuming you're using cookies instead of URL parameters, as you are). As a result, you can't destroy the link to one without destroying the link to the other. You could, however, work around this by doing your own state management - set your own cookie on the browser, then retrieve data based on the value of that cookie. A better question for you, though, might be why you're using both Session and Client variables - two ways of doing the same thing? That's probably not the best approach. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: deleting session variables
From: "Dave Watts" [EMAIL PROTECTED] Subject: RE: deleting session variables A better question for you, though, might be why you're using both Session and Client variables - two ways of doing the same thing? That's probably not the best approach. On first impression using client and session in the same app could be viable if; 1. client requires accessing client storage while session "stays within" the CFAS memory space. 2. if there are vars that need to persist after a session and that are useful to have readily available for a next session 3. assuming session is faster than client {1] On second impression the question needs to be answered whether once client are read if the values also reside in the CAFS memory space - if so, for how long, and how granular is the rentention - i.e. assuming storage is in a db, does one read of any client's vars cause all client's vars to persist in memory or is the clientmanagement selective to retrieving just the particular client vars relative to that client's current session/http request? If every refeence to a client var causes a db read or write, then I would say that the only reason to mix client and session is to intialize a client seesion with client vars, but run the session with session vars. I doubt that client vars are kept in memory for a defined timeout period (or any other undocumented timeout period other than possibly applicationtimeout) like session vars so each reference to a client var will cause a db write or read. That has to mean session vars, once set, are faster. I can see an app organized so that upon logIn client vars in storage are used to intialize the current session, then these values are moved into a session layer for speed with any subsequent client value assignments done only for the purpose of preserving values that need to persist past the end of the current session. I would appreciate any clarification of any of this thinking. (above is not meant to cover clustering issues and assumes no design inhibitions due to ram constraints) Pan ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: deleting session variables
use StructDelete(). use "session" as the key and just use the session var name. -Original Message- From: S R [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 12, 2000 2:32 PM To: CF-Talk Subject: deleting session variables Hi, I am using this code to delete my session variables when a user closes their browser: cfif IsDefined("Cookie.CFID") AND IsDefined("Cookie.CFTOKEN") cfset cfid_local = Cookie.CFID cfset cftoken_local = Cookie.CFTOKEN cfcookie name="CFID" value="#cfid_local#" cfcookie name="CFTOKEN" value="#cftoken_local#" /cfif The only problem is that it also deletes my client variables upon closing the browser. Is there any way to just delete session variables and leave the client intact?? Sal ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Deleting Session Variables
on 11/20/00 5:40 PM, Bill Killillay at [EMAIL PROTECTED] wrote: Seems to me that if you do it this way, your not only expiring the session var's for the intended user, but also for everybody else using that "application" at that time. Hmm. I don't think it works that way. This method is recommended in the Allaire knowledgebase article on the subject of deleting session variables. -- Rob Keniger big bang solutions mailto:[EMAIL PROTECTED] http://www.bigbang.net.au ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Deleting Session Variables
hmmm...there's an easier way to delete a session var; within CFSCRIPT, use StructDelete(session, varname); where varname is the session varname. -Original Message- From: Scott Wolf [mailto:[EMAIL PROTECTED]] Sent: Sunday, November 19, 2000 11:49 PM To: CF-Talk Subject: RE: Deleting Session Variables Thanks for the help. I've got it working now. :P Scott Wolf -Original Message- From: Bill Killillay [mailto:[EMAIL PROTECTED]] Sent: Monday, November 20, 2000 2:41 AM To: CF-Talk Subject: RE: Deleting Session Variables Rob, Seems to me that if you do it this way, your not only expiring the session var's for the intended user, but also for everybody else using that "application" at that time. Just expire the session in Application.cfm: cfif isdefined("logout") cfapplication name="myapp" sessionmanagement="yes" sessiontimeout=#createtimespan(0,0,0,0)# cfelse cfapplication name="myapp" sessionmanagement="yes" sessiontimeout=#createtimespan(0,2,0,0)# /cfif Pass the parameter "logout" to any page and the session will die. You could also set cookie.cfid and cookie.cftoken to 0 and expire them too. Anybody else with any thoughts on the matter? cf_warrior name="Bill" ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Deleting Session Variables
actually, SESSION variables are in a structure (in 4.5+). you can do a StructDelete(SESSION, varname) to get rid of a particular SESSION variable. chris olive, cio cresco technologies [EMAIL PROTECTED] http://www.crescotech.com -Original Message- From: Scott Wolf [mailto:[EMAIL PROTECTED]] Sent: Monday, November 20, 2000 1:52 AM To: CF-Talk Subject: Deleting Session Variables I know this question was asked just a couple of days ago, but I lost all of my old e-mail when I formatted my HD. How can I remove a session variable completely? I know I can change the value using CFSET (i.e. CFSET Session.LoggedIn = "1") but I don't know how to remove it altogether. Please let me know if you can. Thanks! Scott Wolf ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Deleting Session Variables
this works in 4.0.1 as well. -Original Message- From: Christopher Olive, CIO [mailto:[EMAIL PROTECTED]] Sent: Monday, November 20, 2000 6:49 AM To: CF-Talk Subject: RE: Deleting Session Variables actually, SESSION variables are in a structure (in 4.5+). you can do a StructDelete(SESSION, varname) to get rid of a particular SESSION variable. chris olive, cio cresco technologies [EMAIL PROTECTED] http://www.crescotech.com -Original Message- From: Scott Wolf [mailto:[EMAIL PROTECTED]] Sent: Monday, November 20, 2000 1:52 AM To: CF-Talk Subject: Deleting Session Variables I know this question was asked just a couple of days ago, but I lost all of my old e-mail when I formatted my HD. How can I remove a session variable completely? I know I can change the value using CFSET (i.e. CFSET Session.LoggedIn = "1") but I don't know how to remove it altogether. Please let me know if you can. Thanks! Scott Wolf ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Deleting Session Variables
cfloop collection=#Session# ITEM="key" cfif Not ListFindNoCase('CFID,CFTOKEN,SESSIONID,URLTOKEN',Key) cfset StructDelete(Session,Key) /cfif /cfloop -Original Message- From: Scott Wolf [mailto:[EMAIL PROTECTED]] Sent: Sunday, November 19, 2000 11:14 PM To: CF-Talk Subject: RE: Deleting Session Variables Will arraydelete kill all of the session vars for just that one session? I'm trying to write a logoff page that completely ends a session, and I just want to make sure that I can scrap all the vars without affecting any other user's session. Scott Wolf -Original Message- From: Scott M. Berry [mailto:[EMAIL PROTECTED]] Sent: Monday, November 20, 2000 2:13 AM To: CF-Talk Subject: Re: Deleting Session Variables Session variables are stored in an array. You can kill the array (arraydelete()) but that will kill all the vars and Allaire does not recommend that. You can probably do some nifty functions by converting the array to a list, and finding out the position of the var you want to delete and then doing a arraydeleteat() for that var.. not sure.. guessing here. Scott M. Berry :-: [Staff Developer] annex.com, Inc. - http://www.annex.com/ - Original Message - From: "Scott Wolf" [EMAIL PROTECTED] To: "CF-Talk" [EMAIL PROTECTED] Sent: Sunday, November 19, 2000 10:52 PM Subject: Deleting Session Variables I know this question was asked just a couple of days ago, but I lost all of my old e-mail when I formatted my HD. How can I remove a session variable completely? I know I can change the value using CFSET (i.e. CFSET Session.LoggedIn = "1") but I don't know how to remove it altogether. Please let me know if you can. Thanks! Scott Wolf ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Deleting Session Variables
Session variables are stored in an array. You can kill the array (arraydelete()) but that will kill all the vars and Allaire does not recommend that. You can probably do some nifty functions by converting the array to a list, and finding out the position of the var you want to delete and then doing a arraydeleteat() for that var.. not sure.. guessing here. Scott M. Berry :-: [Staff Developer] annex.com, Inc. - http://www.annex.com/ - Original Message - From: "Scott Wolf" [EMAIL PROTECTED] To: "CF-Talk" [EMAIL PROTECTED] Sent: Sunday, November 19, 2000 10:52 PM Subject: Deleting Session Variables I know this question was asked just a couple of days ago, but I lost all of my old e-mail when I formatted my HD. How can I remove a session variable completely? I know I can change the value using CFSET (i.e. CFSET Session.LoggedIn = "1") but I don't know how to remove it altogether. Please let me know if you can. Thanks! Scott Wolf ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Deleting Session Variables
Will arraydelete kill all of the session vars for just that one session? I'm trying to write a logoff page that completely ends a session, and I just want to make sure that I can scrap all the vars without affecting any other user's session. Scott Wolf -Original Message- From: Scott M. Berry [mailto:[EMAIL PROTECTED]] Sent: Monday, November 20, 2000 2:13 AM To: CF-Talk Subject: Re: Deleting Session Variables Session variables are stored in an array. You can kill the array (arraydelete()) but that will kill all the vars and Allaire does not recommend that. You can probably do some nifty functions by converting the array to a list, and finding out the position of the var you want to delete and then doing a arraydeleteat() for that var.. not sure.. guessing here. Scott M. Berry :-: [Staff Developer] annex.com, Inc. - http://www.annex.com/ - Original Message - From: "Scott Wolf" [EMAIL PROTECTED] To: "CF-Talk" [EMAIL PROTECTED] Sent: Sunday, November 19, 2000 10:52 PM Subject: Deleting Session Variables I know this question was asked just a couple of days ago, but I lost all of my old e-mail when I formatted my HD. How can I remove a session variable completely? I know I can change the value using CFSET (i.e. CFSET Session.LoggedIn = "1") but I don't know how to remove it altogether. Please let me know if you can. Thanks! Scott Wolf ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Deleting Session Variables
Scott, Here is the method that I use. Hope it helps some. cfset sessionvars = "" cfloop collection="#session#" item=key cfset sessionvars = listappend(sessionvars, key) /cfloop cfloop list="sessionvars" index="deletekey" delimiters="," cfset StructDelete(session,"#deletekey#") /cfloop How can I remove a session variable completely? I know I can change the value using CFSET (i.e. CFSET Session.LoggedIn = "1") but I don't know how to remove it altogether. cf_warrior name="Bill" ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Deleting Session Variables
on 11/20/00 5:13 PM, Scott Wolf at [EMAIL PROTECTED] wrote: Will arraydelete kill all of the session vars for just that one session? I'm trying to write a logoff page that completely ends a session, and I just want to make sure that I can scrap all the vars without affecting any other user's session. Just expire the session in Application.cfm: cfif isdefined("logout") cfapplication name="myapp" sessionmanagement="yes" sessiontimeout=#createtimespan(0,0,0,0)# cfelse cfapplication name="myapp" sessionmanagement="yes" sessiontimeout=#createtimespan(0,2,0,0)# /cfif Pass the parameter "logout" to any page and the session will die. You could also set cookie.cfid and cookie.cftoken to 0 and expire them too. -- Rob Keniger big bang solutions mailto:[EMAIL PROTECTED] http://www.bigbang.net.au ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Deleting Session Variables
Rob, Seems to me that if you do it this way, your not only expiring the session var's for the intended user, but also for everybody else using that "application" at that time. Just expire the session in Application.cfm: cfif isdefined("logout") cfapplication name="myapp" sessionmanagement="yes" sessiontimeout=#createtimespan(0,0,0,0)# cfelse cfapplication name="myapp" sessionmanagement="yes" sessiontimeout=#createtimespan(0,2,0,0)# /cfif Pass the parameter "logout" to any page and the session will die. You could also set cookie.cfid and cookie.cftoken to 0 and expire them too. Anybody else with any thoughts on the matter? cf_warrior name="Bill" ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Deleting Session Variables
Try this... This is what I use to kill all session variables. Works perfectly for logout: CFSCRIPTStructClear(Session);/CFSCRIPT CFCOOKIE NAME="CFID" VALUE="0" EXPIRES="NOW" CFCOOKIE NAME="CFTOKEN" VALUE="0" EXPIRES="NOW" Danny Davis - Original Message - From: "Scott Wolf" [EMAIL PROTECTED] To: "CF-Talk" [EMAIL PROTECTED] Sent: Monday, November 20, 2000 2:13 AM Subject: RE: Deleting Session Variables Will arraydelete kill all of the session vars for just that one session? I'm trying to write a logoff page that completely ends a session, and I just want to make sure that I can scrap all the vars without affecting any other user's session. Scott Wolf -Original Message- From: Scott M. Berry [mailto:[EMAIL PROTECTED]] Sent: Monday, November 20, 2000 2:13 AM To: CF-Talk Subject: Re: Deleting Session Variables Session variables are stored in an array. You can kill the array (arraydelete()) but that will kill all the vars and Allaire does not recommend that. You can probably do some nifty functions by converting the array to a list, and finding out the position of the var you want to delete and then doing a arraydeleteat() for that var.. not sure.. guessing here. Scott M. Berry :-: [Staff Developer] annex.com, Inc. - http://www.annex.com/ - Original Message - From: "Scott Wolf" [EMAIL PROTECTED] To: "CF-Talk" [EMAIL PROTECTED] Sent: Sunday, November 19, 2000 10:52 PM Subject: Deleting Session Variables I know this question was asked just a couple of days ago, but I lost all of my old e-mail when I formatted my HD. How can I remove a session variable completely? I know I can change the value using CFSET (i.e. CFSET Session.LoggedIn = "1") but I don't know how to remove it altogether. Please let me know if you can. Thanks! Scott Wolf ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Deleting Session Variables
Thanks for the help. I've got it working now. :P Scott Wolf -Original Message- From: Bill Killillay [mailto:[EMAIL PROTECTED]] Sent: Monday, November 20, 2000 2:41 AM To: CF-Talk Subject: RE: Deleting Session Variables Rob, Seems to me that if you do it this way, your not only expiring the session var's for the intended user, but also for everybody else using that "application" at that time. Just expire the session in Application.cfm: cfif isdefined("logout") cfapplication name="myapp" sessionmanagement="yes" sessiontimeout=#createtimespan(0,0,0,0)# cfelse cfapplication name="myapp" sessionmanagement="yes" sessiontimeout=#createtimespan(0,2,0,0)# /cfif Pass the parameter "logout" to any page and the session will die. You could also set cookie.cfid and cookie.cftoken to 0 and expire them too. Anybody else with any thoughts on the matter? cf_warrior name="Bill" ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists