My session vars are not timming out when I set them to. In my Application.cfm page I have...
<CFAPPLICATION NAME="itsite"
SESSIONMANAGEMENT="Yes"
SETCLIENTCOOKIES="Yes"
SESSIONTIMEOUT="#CreateTimeSpan(0,9,30,0)#">
Because this is driving me nuts I set the timeout in the CF admin to 9hours 30mins too.
When a user logs in I set a session var like so...
<cfif isdefined('FORM.smtLogin')>
<cfquery datasource="gvdb" name="validateUser">
{call s_it_validateuser '#FORM.txtId#', '#FORM.txtPwd#'}
</cfquery>
<CFIF validateUser.recordcount GT 0>
<CFLOCK TIMEOUT="10" THROWONTIMEOUT="No" TYPE="EXCLUSIVE" SCOPE="SESSION">
<cfset session.groupList = #valuelist(validateUser.group_name)#>
<cfset session.fullname = #validateUser.fullname#>
<cfset session.uid = #validateUser.uid#>
</CFLOCK>
</CFIF>
</CFIF>
On each page I check for the session var like so...
<CFLOCK TIMEOUT="10" THROWONTIMEOUT="No" TYPE="READONLY" SCOPE="SESSION">
<cfif isdefined('session.fullname')>
<cfif #listfind(session.groupList, "Admin"
# GT 0 OR #listfind(session.groupList, "User"
#>
<!--- you are in a group that can access this page --->
<cfset locFullName = #session.fullname#>
<cfset locUid = #session.uid#>
<cfelse>
<!--- You are not good enough to be here --->
You must be a member of the "Admin" or "User" group. Please contact the site admin to gain access to this site.
</cfif>
<cfelse>
<!--- need to login! --->
<cflocation url="#BaseHREF#/index.cfm?loginfirst=true">
</cfif>
</CFLOCK>
I also use a JS function to warn them 5 mins before logout. Then I notify them if it does timeout.
All of this worked when I had the timeout max set to 1 hour. I extended the timeout to 9.5 hours (all work day) and the JS seems to work but the session vars timout pre maturely.
So why is the new timeout setting not working?
Thanks in advance for any suggestions.
<CFAPPLICATION NAME="itsite"
SESSIONMANAGEMENT="Yes"
SETCLIENTCOOKIES="Yes"
SESSIONTIMEOUT="#CreateTimeSpan(0,9,30,0)#">
Because this is driving me nuts I set the timeout in the CF admin to 9hours 30mins too.
When a user logs in I set a session var like so...
<cfif isdefined('FORM.smtLogin')>
<cfquery datasource="gvdb" name="validateUser">
{call s_it_validateuser '#FORM.txtId#', '#FORM.txtPwd#'}
</cfquery>
<CFIF validateUser.recordcount GT 0>
<CFLOCK TIMEOUT="10" THROWONTIMEOUT="No" TYPE="EXCLUSIVE" SCOPE="SESSION">
<cfset session.groupList = #valuelist(validateUser.group_name)#>
<cfset session.fullname = #validateUser.fullname#>
<cfset session.uid = #validateUser.uid#>
</CFLOCK>
</CFIF>
</CFIF>
On each page I check for the session var like so...
<CFLOCK TIMEOUT="10" THROWONTIMEOUT="No" TYPE="READONLY" SCOPE="SESSION">
<cfif isdefined('session.fullname')>
<cfif #listfind(session.groupList, "Admin"
<!--- you are in a group that can access this page --->
<cfset locFullName = #session.fullname#>
<cfset locUid = #session.uid#>
<cfelse>
<!--- You are not good enough to be here --->
You must be a member of the "Admin" or "User" group. Please contact the site admin to gain access to this site.
</cfif>
<cfelse>
<!--- need to login! --->
<cflocation url="#BaseHREF#/index.cfm?loginfirst=true">
</cfif>
</CFLOCK>
I also use a JS function to warn them 5 mins before logout. Then I notify them if it does timeout.
All of this worked when I had the timeout max set to 1 hour. I extended the timeout to 9.5 hours (all work day) and the JS seems to work but the session vars timout pre maturely.
So why is the new timeout setting not working?
Thanks in advance for any suggestions.