Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
<?php
// LIMONADE SESSION FEATURES EXAMPLES
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
Something went wrong with that request. Please try again.