Gantry-Plugins-Session
view release on metacpan or search on metacpan
lib/Gantry/Plugins/Session.pm view on Meta::CPAN
$cookie = $crypt->encrypt(time, {}, rand(), $$);
$gobj->set_cookie(
{
name => '_session_id_',
value => $cookie,
path => '/'
}
);
$gobj->relocate($cookiecheck);
}
}
sub do_cookiecheck {
my $gobj = shift;
my $session;
my $app_rootp = $gobj->app_rootp || "/";
# if cookies are enabled they should be returned on the redirect
if ($session = $gobj->get_cookies('_session_id_')) {
# Ok, redirect them back to the applicaion
$gobj->session_inited(1);
$gobj->session_id($session);
$gobj->session_store($lock, '0');
$gobj->relocate($app_rootp);
} else {
# Hmmm, OK, lets give them a nudge
my $session_title = $gobj->fish_config('session_title') || 'Missing Cookies';
my $session_wrapper = $gobj->fish_config('session_wrapper') || 'default.tt';
my $session_template = $gobj->fish_config('session_template') || 'session.tt';
$gobj->template_wrapper($session_wrapper);
( run in 2.318 seconds using v1.01-cache-2.11-cpan-5511b514fd6 )