Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Session variables being lost

Explorer ,
Apr 24, 2007 Apr 24, 2007
In my onApplicationStart method (which should tell you I'm using an Application.cfC, not cfM), I have a cfif loop that passes a value to a custom tag and returns a form variable. I'm then reassigning that variable to a session variable. In IE, this works just fine; in Firefox, though, the session variable is NOT being set.

What might be causing this, and is there a workaround?
677
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , May 04, 2007 May 04, 2007
I found the answer.

I simply attached the URLToken to my URL on my page call, and the session variable passed with no problem.
Translate
LEGEND ,
Apr 24, 2007 Apr 24, 2007
post your code.

i suspect the problem is that IE does not treat application properly:
if you set anything in onApplicationStart in your Application.cfc it
will be set ONLY ONCE when the application starts. to make the
onApplicationStart fire again, you either have to restart the CF service
or call the method as a function from a cfscript.

i believe FF is doing things exactly how they should be done, while IE
does its own tricks...

anyway, why not set your session var in onSessionStart instead of
onApplicationStart?
--

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 25, 2007 Apr 25, 2007
I just looked back at my code; I am in fact instantiating the session structure object variable in the onSessionStart() method.

FireFox does persist the structure; but I'm having an issue accessing it after I set permission levels for the application.

IE is not persisting the values in the structure from one form to the next, which is very very frustrating, since I'm actually using a wrapper index page and a cfinclude to bring in each form.

UPDATED: The code I had in my onSessionStart follows. There are two custom tags here: cf_demouser creates a form from which to choose from the company user list; it returns a form.username variable; cf_assignrole takes the acctno of the AuthUser from the query and assigns one of eight roles; the only roles that are authorized here are divisionmgr and manager.

This code executes perfectly outside of the onSessionStart() method, but it does NOT execute the same way in that method. Are there limitations to queries or variables in the onSessionStart()? If so, why are these not in LiveDocs???

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 25, 2007 Apr 25, 2007
> FireFox does persist the structure; but I'm having an issue accessing it after
> I set permission levels for the application.

what's the "issue", how are you accessing the structure and how do you
set permission levels?
do you use the login framework? if so, make sure you set your session
vars before the <cfloginuser> tag...

> IE is not persisting the values in the structure from one form to the next,
> which is very very frustrating, since I'm actually using a wrapper index page
> and a cfinclude to bring in each form.

did you try debugging it with <cfdump> of your structure on the index
page and opn the cfincluded forms? could it be security settings in IE
that interfere (i.e. prevent cookies from being written)?


--

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 01, 2007 May 01, 2007
The issue referred to an external CF custom tag, which called another demo application to set a testing user. However, after further testing, I realize that demo app won't function properly with this application, so I've removed it.

Authentication is being set by an LDAP query; this application that I am working on is going to be a sub-application of a larger application, and the authenticated user is being set as a session variable as well (I think...). However, I'm creating a new session variable for this application, and simply passing the authenticated user into my app (the outer app uses the variable auth_user; I'm using the variable authuser, so there is no name conflict).

Again, it is IE that is not persisting the session. Firefox is doing so. I have looked in the advanced settings for IE, and there is nothing about persisting session variables to check or uncheck. Also, this application will probably be used mostly by users using IE 6 with default settings, so I'm going to need to find a workaround for IE.

Your help is most appreciated.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 04, 2007 May 04, 2007
LATEST
I found the answer.

I simply attached the URLToken to my URL on my page call, and the session variable passed with no problem.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources