Seonna, can you just set the session vars on the page like you are doing already, then do a cfabort, before the cfabort put a href, i.e. <a href="test.cfm">test</a> on this test.cfm you try and output the session vars you just set.
See what that does for you, if they are not present then I reckon you are not accepting cookies, if they do appear I have no clue further. Taco Fleur 07 3535 5072 Blog: http://www.tacofleur.com/index/blog/ Methodology: http://www.tacofleur.com/index/methodology/ Tell me and I will forget Show me and I will remember Teach me and I will learn -----Original Message----- From: Seona Bellamy [mailto:[EMAIL PROTECTED] Sent: Monday, 2 February 2004 2:15 PM To: CFAussie Mailing List Subject: [cfaussie] RE: Trying to write some session variables Hmm... just tried, but still no joy. :( And to Steve Onnis: Yes, it is. If I remove the <cflocation> and just have some code underneath to show the variable values, it's all showing up beautifully. So I think we're going with the verdict that it has nothing to do with the variables being overwritten by the code that is meant to set the defaults, but is caused by the <cflocation> preventing the new values from being set in the first place. So my next question is: is there a way to do a similar thing without using <cflocation>? What other ways are there of redirecting the user, and do any of them allow session variables / cookies to be set first? Cheers, Seona. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Clifton Steve Sent: Monday, 2 February 2004 3:03 PM To: CFAussie Mailing List Subject: [cfaussie] RE: Trying to write some session variables Actually... My code was wrong... should have been like this: <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> So that the code in the application.cfm template is only processed IF session.log_Access is NOT already defined. steve -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Seona Bellamy Sent: Monday, 2 February 2004 2:45 PM To: CFAussie Mailing List Subject: [cfaussie] RE: Trying to write some session variables Clifton, Thanks, but I thought that <cfparam> only wrote to the variable if it didn't already exist? I just tried putting the <cfif> statement you describe as it was mentioned by Gareth as well, and it doesn't seem to make any difference. Cheers, Seona. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Clifton Steve Sent: Monday, 2 February 2004 2:37 PM To: CFAussie Mailing List Subject: [cfaussie] RE: Trying to write some session variables Seona, The way application.cfm works is that it runs before any template, so what your page is doing is: 1. the user logs in so the application.cfm template is processed before the login_action.cfm template, so at that point the session variables are set correctly 2. the cflocation sends the user to the index.cfm page BUT... 3. the application.cfm template is processed before the index.cfm page, effectively resetting all your session variables to the defaults! Hope this makes sense? I suggest putting an <cfif isdefined("session.log_Access")> around the code in the application.cfm template so that if these variables are defined then don't reset them. Regards, Steve c -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Seona Bellamy Sent: Monday, 2 February 2004 2: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 --- 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 --- 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
