Created
March 24, 2014 22:54
-
-
Save bennadel/9751090 to your computer and use it in GitHub Desktop.
Turning Off Session Management for Web Spiders
This file contains 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
// Define the application. To stop unnescessary memory usage, we are going to give | |
// web crawler no session management. This way, they don't have to worry about cookie | |
// acceptance and object persistance (except for APPLICATION scope). | |
if ((NOT Len(CGI.http_user_agent)) OR REFindNoCase("Slurp|Googlebot|BecomeBot|msnbot|Mediapartners-Google|ZyBorg|RufusBot|EMonitor|researchbot|IP2MapBot|GigaBot|Jeeves|Exabot|SBIder|findlinks|YahooSeeker|MMCrawler|MJ12bot|OutfoxBot|jBrowser|ZiggsBot|Java|PMAFind|Blogbeat|TurnitinBot|ConveraCrawler|Ocelli|ColdFusion", CGI.http_user_agent)){ | |
// This application definition is for robots that do NOT need sessions. | |
THIS.Name = "KinkySolutions v.1 {dev}"; | |
THIS.SessionManagement = false; | |
THIS.SetClientCookies = false; | |
THIS.ClientManagement = false; | |
THIS.SetDomainCookies = false; | |
// Set the flag for session use. | |
REQUEST.HasSessionScope = false; | |
} else { | |
// This application is for the standard user. | |
THIS.Name = "KinkySolutions v.1 {dev}"; | |
THIS.SessionManagement = true; | |
THIS.SetClientCookies = true; | |
THIS.SessionTimeout = CreateTimeSpan(0, 0, 20, 0); | |
THIS.LoginStorage = "SESSION"; | |
// Set the flag for session use. | |
REQUEST.HasSessionScope = true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment