summaryrefslogtreecommitdiffstats
path: root/pyload/web/app/scripts/models/UserSession.js
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/web/app/scripts/models/UserSession.js')
-rw-r--r--pyload/web/app/scripts/models/UserSession.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/pyload/web/app/scripts/models/UserSession.js b/pyload/web/app/scripts/models/UserSession.js
new file mode 100644
index 000000000..a7e9aa848
--- /dev/null
+++ b/pyload/web/app/scripts/models/UserSession.js
@@ -0,0 +1,20 @@
+define(['jquery', 'backbone', 'underscore', 'utils/apitypes', 'cookie'],
+ function($, Backbone, _, Api) {
+ 'use strict';
+
+ return Backbone.Model.extend({
+
+ idAttribute: 'username',
+
+ defaults: {
+ username: null,
+ permissions: null,
+ session: null
+ },
+
+ // Model Constructor
+ initialize: function() {
+ this.set('session', $.cookie('beaker.session.id'));
+ }
+ });
+ }); \ No newline at end of file