Created
April 1, 2013 11:38
-
-
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
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
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