define(
	['Resources'],
	function(resources) {
		var UserSession = Backbone.Model.extend({
			initialize: function() {
				this.url = resources.get('public-user-session').get('href');
				this.fetch({async: false});		
			},
			isLoggedIn: function() {
				var loggedIn = false;
				var mhpUser = this.get('mhpuser');
				
				if (typeof mhpUser !== 'undefined' && mhpUser) {
					loggedIn = true;
				}

				return loggedIn;
			}
		});
		return UserSession;
	}
);