Element is undefined in session??
Posted on 2003-03-20
I am trying to use some session variables. Sometimes they work and other times I get that the element is undefined in session. What am I doing wrong?
This is where I have my session variables defined:
<CFSET SESSION.LOGGEDIN = TRUE>
<CFSET session.userid = checkuser.userid>
<cfset session.username = checkuser.username>
<cfset session.accountnbr = checkuser.accountnbr>
I call them in my main menu screen, to only get the systems that they have access to show on the main menu screen.
<cfquery datasource="database" name="getuseraccess">
from useraccess inner join system on useraccess.systemcode = system.systemcode
(userid = #session.userid# and
systemaccess = 'yes')
Then I call the session userid within my directory in another Application.cfm file to verify that the user has access to that file, incase they bypass the login screen.
<cfquery name="usersec" datasource="database">
WHERE (UserId = #session.userid#
and UserAccess.SystemCode = 3)
The session.userid variable works for my mainmenu, but not in the Application.cfm file. Does anyone know what I am doing wrong?