Skip to content

Instantly share code, notes, and snippets.

@Macagare
Created November 22, 2012 13:14
Show Gist options
  • Save Macagare/4131119 to your computer and use it in GitHub Desktop.
Save Macagare/4131119 to your computer and use it in GitHub Desktop.
Coldfusion: session test on multiple servers
<cfscript>
writeOutput("You are on server: " & cgi.local_host & "<br/>");
if( structKeyExists(url, "action") ) {
if ( url.action eq "new" ) {
createSessionTest();
}
} else {
if( not structKeyExists(session, "test") ){
writeOutput("Sorry, but there is no session test");
}
}
function createSessionTest(){
session["test"] = structNew();
session.test["timestamp"] = dateDiff( 'n', createDate(1970,1,1), now() );
session.test["server"] = cgi.local_host;
writeOutput("session test created...");
}
writeDump(session);
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment