Gareth, Thanks. Tried it, and it doesn't seem to make any difference. Besides, I thought the whole point of <cfparam> was that it wouldn't overwrite the variable if it already existed?
Cheers, Seona. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Gareth Edwards Sent: Monday, 2 February 2004 2:35 PM To: CFAussie Mailing List Subject: [cfaussie] RE: Trying to write some session variables Seona. Not sure, but try setting a flag or testing for one of the values existing when setting it in the application.cfm It may just be overwriting them everytime the page is run. something like? <cfif NOT isDefined('session.log_access')> <cflock scope="session" type="exclusive" timeout="10"> <cfparam name="session.log_Access" default="0"> <cfparam name="session.log_ID" default=""> <cfparam name="session.log_Name" default=""> </cflock> </cfif> Dont know if it will work. But maybe give it a try? cheers Gareth. -----Original Message----- From: Seona Bellamy [mailto:[EMAIL PROTECTED] Sent: Monday, 2 February 2004 1:31 PM To: CFAussie Mailing List Subject: [cfaussie] Trying to write some session variables Hi guys, I have a problem where I am specifying some default values in Application.cfm as follows: <cflock scope="session" type="exclusive" timeout="10"> <cfparam name="session.log_Access" default="0"> <cfparam name="session.log_ID" default=""> <cfparam name="session.log_Name" default=""> </cflock> I am then running some code when a user logs in which should, in theory, overwrite these values with the logged-in values: <cfoutput> <cfif qry_GetUserLogin.recordcount> <cflock scope="session" type="exclusive" timeout="10"> <cfset session.log_Access = "#qry_GetUserLogin.AccessLevel#"> <cfset session.log_Name = "#qry_GetUserLogin.LoginName#"> <cfset session.log_ID = "#qry_GetUserLogin.ID#"> <cflocation url="index.cfm" addtoken="no"> </cflock> <cfelse> <cflocation url="index.cfm" addtoken="no"> </cfif> </cfoutput> What I am getting, however, is that when I am returned to the home page I am not getting the new values in the session variables (I have some temporary code to output the values of these variables on the front page so I can monitor what's happening to them). The really strange thing is that I found if I remove the <cflocation> after I set the variables, then they take. Why is this? Surely the <cflocation> shouldn't actually take effect until it reaches that part of the code, should it? Cheers, Seona. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.576 / Virus Database: 365 - Release Date: 30/01/2004 --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia http://www.mxdu.com/ + 24-25 February, 2004 --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia http://www.mxdu.com/ + 24-25 February, 2004 --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.576 / Virus Database: 365 - Release Date: 30/01/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.576 / Virus Database: 365 - Release Date: 30/01/2004 --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia http://www.mxdu.com/ + 24-25 February, 2004
