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

Element undefined in SESSION.

Guest
Dec 21, 2011 Dec 21, 2011

Copy link to clipboard

Copied

Hi all, i have this problem of session element missing hope someone could help.

It happens only occassionally but often enough to worry about. Neither myself nor my client could simulate this. I'm using CFMX7 enterprise on IIS6.0. Below is the error dump that was send to my mail box when this happens:

Error Type :
coldfusion.runtime.CfErrorWrapper

Error Message :
Element mystruct.myvar1 is undefined in SESSION.

Root Cause :
coldfusion.runtime.UndefinedElementException: Element
mystruct.myvar1 is undefined in SESSION.

Detailed Diagnostic :
Element
mystruct.myvar1 is undefined in SESSION.
The error occurred on line 104.

When this happens the whole session is actually missing! Below is the dump of the session var when this happens:

struct

sessionid

2430a3b64791$7Fd$3F$

urltoken

CFID=4676763&CFTOKEN=97421832dd674074-8E1D24D9-145E-DE36-F3759C184BD28 0D0&jsessionid=2430a3b64791$7Fd$3F$

Normally it should contains the struct myStruct in the dump, but when this error happens it seems that the whole struct is gone. I have gone through the coding over and over again and try to simulate this across different browsers but could not repeat it, yet every single day i receive 10-20 error emails like this (The application currently expecting upwards of 2000 hits daily). The error message sometimes will indicate other struct elements missing, but the pattern is similar.

Any help or suggestion is deeply appreciated.

Regards

TOPICS
Advanced techniques

Views

2.8K

Translate

Translate

Report

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 ,
Dec 21, 2011 Dec 21, 2011

Copy link to clipboard

Copied

It just sounds to me like the user's session is timing out (which is an entirely legitimate occurrence), and your code can run in such a way that it ass-u-me`s that some or other session variable exists when there's a case that it might not.

The only session variables one can rely on existing are ones created in onSessionStart().  Any other ones need to be checked-for existing before being used.

--

Adam

Votes

Translate

Translate

Report

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
Guest
Dec 22, 2011 Dec 22, 2011

Copy link to clipboard

Copied

Thanks for the reply, session time out shouldn't be the reason as i can trace the starting time until the time of error is well within the time out limit.

Votes

Translate

Translate

Report

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 ,
Dec 22, 2011 Dec 22, 2011

Copy link to clipboard

Copied

Or they could be blowing away their cookies or something.

Where does the variable in question get created?  Not in onSessionStart(), I wager.

--
Adam

Votes

Translate

Translate

Report

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 ,
Dec 22, 2011 Dec 22, 2011

Copy link to clipboard

Copied

When I see disappearing sesssion variables it's usually a result of the user having multiple tabs or browser windows open.  They do some stuff on tab1 and then go to tab2 where they do something else on the same site.  Since it's all the same session, the action on tab2 affects the session variables on tab1.

Votes

Translate

Translate

Report

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
Guest
Dec 22, 2011 Dec 22, 2011

Copy link to clipboard

Copied

Thanks for the reply, but it is not possible to do so as far as the application design allow. There's no hyperlink in the page in which you can open a separate tab for the same session. The only way to do this is to open another tab and restart the whole process again which will result in a different session id and i think that will not interfere with the other tab.

Votes

Translate

Translate

Report

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 ,
Dec 22, 2011 Dec 22, 2011

Copy link to clipboard

Copied

Different browser windows of the same browser type all use the SAME session.

--

Adam

Votes

Translate

Translate

Report

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 ,
Dec 22, 2011 Dec 22, 2011

Copy link to clipboard

Copied

LATEST

Regarding: "The only way to do this is to open another tab and restart the whole process again which will result in a different session id."

My observations do not support this statement.

Votes

Translate

Translate

Report

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
Documentation