Skip to content

Instantly share code, notes, and snippets.

@timsayshey
Forked from roryl/Application.cfc
Created November 11, 2021 15:14
Show Gist options
  • Save timsayshey/15a98537576364998a28606c80a91172 to your computer and use it in GitHub Desktop.
Save timsayshey/15a98537576364998a28606c80a91172 to your computer and use it in GitHub Desktop.
Lucee Database Client Storage
component {
this.datasources["lucee_sessions"] = {
class: 'org.gjt.mm.mysql.Driver'
, connectionString: 'jdbc:mysql://192.168.33.10:3306/lucee_sessions?useUnicode=true&characterEncoding=UTF-8&useLegacyDatetimeCode=true'
, username: 'lucee_sessions'
, password: "encrypted:8c3ea865feab8133a7614f58aee150cddee0ed6f82a476f1"
// optional settings
, storage:true // default: false
};
this.sessionTimeout = createTimeSpan(0,0,20,0); //Set a default session timeout of 20 minutes
this.sessionStorage = "lucee_sessions"; //Set our session storage to the lucee_sessions datasource
this.clientTimeout = createTimeSpan(0,1,0,0);
this.clientManagement = true;
this.clientStorage = "lucee_sessions";
this.clientCluster = true; //Set true if more than one Lucee instance connected to the same client store
function onSessionStart(){
session.someData = "My Data";
}
function onRequestStart(){
client.myData = "My Client Data";
}
}
<cfdump var="#now()#">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment