Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
require_once 'lib/limonade.php';
function configure()
// by default, session is enable. It automaticaly start a session with LIM_SESSION_NAME as name
option('session', false); // disable
option('session', true); // enable
option('session', 'my_session_name'); // enable with a specific session name
dispatch('/', 'example_index');
function example_index()
// now you can manage session vars as normal
$_SESSION['my_var'] = 'my_value';
return html( '<p><a href="'
. url_for('page_two')
. '">Go to page two</a></p>' );
dispatch('/page_two', 'example_two');
function example_two()
// now accessing previously set session variable
$my_var = $_SESSION['my_var'];
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment