Created
June 12, 2013 08:19
-
-
Save akshar100/5763632 to your computer and use it in GitHub Desktop.
Using mojito-session-addon example
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
/*jslint anon:true, sloppy:true, nomen:true*/ | |
YUI.add('home', function(Y, NAME) { | |
/** | |
* The home module. | |
* | |
* @module home | |
*/ | |
/** | |
* Constructor for the Controller class. | |
* | |
* @class Controller | |
* @constructor | |
*/ | |
Y.namespace('mojito.controllers')[NAME] = { | |
/** | |
* Method corresponding to the 'index' action. | |
* | |
* @param ac {Object} The ActionContext that provides access | |
* to the Mojito API. | |
*/ | |
index : function(ac) { | |
ac.session.set("test", "test123"); | |
Y.log(ac.session.get("test")); | |
ac.models.get('homeModelFoo').getData(function(err, data) { | |
if (err) { | |
ac.error(err); | |
return; | |
} | |
ac.assets.addCss('./index.css'); | |
ac.done({ | |
status : 'Mojito is working.', | |
data : data | |
}); | |
}); | |
} | |
}; | |
}, '0.0.1', { | |
requires : ['mojito', 'mojito-assets-addon', 'mojito-models-addon', 'homeModelFoo', "mojito-session-addon"] | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i just set a session with .set
Could you tell me how to clear the session