Skip to content

Instantly share code, notes, and snippets.

@akshar100
Created June 12, 2013 08:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akshar100/5763632 to your computer and use it in GitHub Desktop.
Save akshar100/5763632 to your computer and use it in GitHub Desktop.
Using mojito-session-addon example
/*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"]
});
@madhankumarpalanisamy
Copy link

i just set a session with .set
Could you tell me how to clear the session

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