Skip to content

Instantly share code, notes, and snippets.

@kapv89
Created October 15, 2013 22:11
Show Gist options
  • Save kapv89/6999469 to your computer and use it in GitHub Desktop.
Save kapv89/6999469 to your computer and use it in GitHub Desktop.
A simple session implementation for angular apps
define(function () {
return [function () {
var keyName = API_KEY_NAME;
var key = localStorage.getItem('sessionKey');
return {
keyName: function () {
return keyName;
},
key: function () {
return key;
},
setKey: function (val) {
key = val;
localStorage.setItem('sessionKey', key)
}
}
}]
})
@adityamenon
Copy link

The essence of simplicity :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment