Session termination using use CGI::Session; redirection tot eh loginpage doesn't yet work

Discussion in 'Perl Misc' started by Ted Byers, Dec 21, 2011.

  1. Ted Byers

    Ted Byers Guest

    I finally figured out how to clear the session created using:

    my $session = CGI::Session->new('driver:mysql',$query,{ DataSource =>
    'dbi:mysql:profitorius',
    User =>
    'yyyyyyy',
    Password =>
    'xxxxxxx'});

    To do so, I am using:

    $session->clear('CGISESSID');
    $session->delete();
    $session->flush();

    my $scriptname = $query->url(-path=>1);
    $scriptname =~ s/cgi-bin\/logout\.pl/login\.html/;
    print $query->redirect(-location=>"$scriptname",-status=302);
    #print $session->header(-location=>$scriptname);

    When I do this, the session info goes away, but nothing I do has had
    the effect of redirecting the user to the login page. How do I get
    this to redirect to the login page?

    Thanks

    Ted
     
    Ted Byers, Dec 21, 2011
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.