Skip to content

Instantly share code, notes, and snippets.

@jboulhous
Created April 1, 2013 11:38
Show Gist options
  • Save jboulhous/5284476 to your computer and use it in GitHub Desktop.
Save jboulhous/5284476 to your computer and use it in GitHub Desktop.
Sessioned object, could be instanciated to handle some Session vars, this is not realy a great piece of code, but if you don't realy like the Session.get/.set you can still use it this way :p
Sessioned = function(prefix){
this.prefix = prefix || Random.hexString(16)
}
_.extend(Sessioned.prototype,{
get : function(key){
key = this.prefix + '-' + key
return Session.get(key)
},
set : function(key,value){
key = this.prefix + '-' + key
return Session.set(key,value)
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment