sub cgiapp_prerun { my $self = shift; my $current_runmode = shift; # initialize the session my $q =$self->query; my $env = $q->env; my $session = $env->{'psgix.session'}; # Check the Login Status and if the user is logged in, start the chosen action my $login = $session->get('login'); unless ($login) { $self->prerun_mode('show_login') if ($current_runmode ne 'login_cb'); } }