jimmyshoes
Programmer
I am checking for the existence of somevar
The following code works fine
Code:
<cfif not isDefined('session.user.somevar')>
The problem is I want to use structKeyExists(..) but the user struct is not always defined, so if I try the followng then I sometimes get the error Element USER is undefined in SESSION.
Code:
<cfif not structKeyExists(session.user,'somevar')>
This code is repeated a lot and I read the structKeyExists() is more efficient. How can I use it in this scenario?