Last active
January 22, 2020 15:58
-
-
Save robertmorel-uk/5e90ef76a08d57f159ca79da64a8ec34 to your computer and use it in GitHub Desktop.
Mura - prevents bots from starting long sessions in Mura /Coldfusion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!---Place in application.cfc---> | |
<!--- This checks if a cookie is created, for bots this will return false and use the low session timeout ---> | |
<cfif StructKeyExists(cookie, "cfid" ) or StructKeyExists(cookie, "jsessionid" )> | |
<cfset this.sessiontimeout=CreateTimeSpan(0,0,30,0) /> | |
1111 | |
<cfelse> | |
22222 | |
<cfset this.sessiontimeout=CreateTimeSpan(0,0,0,2) /> | |
</cfif> | |
<!---Script based---> | |
<cfscript> | |
if ( structKeyExists(cookie, "cfid") or structKeyExists(cookie, "jsessionid") ) { | |
this.sessiontimeout = CreateTimeSpan(0,0,30,0); | |
writeDump("333333"); | |
} else { | |
this.sessiontimeout = CreateTimeSpan(0,0,0,2); | |
writeDump("444444"); | |
} | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment