Viral Vakani
Viral Vakani

Reputation: 1

Error - Element X is Undefined in Session

Getting this Error

ELEMENT CURRLANGUAGE IS UNDEFINED IN SESSION.

Don't understand why. It was working fine until yesterday

<cfif session.currLanguage eq 'English'>
   <cfset session.currLanguage = ''>
</cfif>

Upvotes: 0

Views: 900

Answers (2)

saravana
saravana

Reputation: 11

Please confirm those too

  1. Please check the value update in the session scope properly.
  2. The session scope will be created based on application name. so if we created the application name as dynamic or updated recently then the session scope will be created as new

Upvotes: 1

TRose
TRose

Reputation: 1738

Because currLanguage is not defined in the session scope. Womp Womp.

Try this to see what IS defined.

<cfdump var="#SESSION#">

It could be that something is not being set when it should. We'd have to see your code to tell for sure. If you think it's working okay and want to prevent unnecessary error messages in the future, you can do a check like this:

<cfif structKeyExists(SESSION, "currLanguage") AND SESSION.currLanguage is "English">
Logic Logic Logic
</cfif>

Upvotes: 9

Related Questions