Here is a basic cflogin approach using variables stored in the CLIENT scope. We use a similar approach for non-sticky sessions in our server cluster behind our load balancer.
This code should work in Application.cfc onRequestStart() :
<cfif structKeyExists(FORM, "pageaction") and FORM.pageAction eq "adminlogin"> <cfif loginSuccessful> <cfset CLIENT.lastHit = now() /> <cfset CLIENT.loggedIn = 1 /> <cfelse> </cfif> <cfelseif structKeyExists(CLIENT, "lasthit") and structKeyExists(COOKIE, "cfid") and structKeyExists(CLIENT, "cfid") and listLast(CGI.SCRIPT_NAME, "/") neq "login.cfm"> <cfif (datediff("n", CLIENT.lastHit, now()) lte 10) and (CLIENT.loggedIn is 1) and (CLIENT.cfid is COOKIE.cfid)> <cfset CLIENT.lastHit = now() /> <cfelse> <cflocation URL="http://mydomain/login.cfm" addtoken="false" /> </cfif> </cfif>
There is custom role material, but I hope this helps as a starting point.
source share