Created
November 22, 2012 13:14
-
-
Save Macagare/4131119 to your computer and use it in GitHub Desktop.
Coldfusion: session test on multiple servers
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
<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