kprasanna_79 has asked for the wisdom of the Perl Monks concerning the following question:

Hai All, I am using mod_perl 1.2.9 and CGI in my application. I am using redirect method to redirect to another page.
my $q = $self->query(); $q->redirect("somepage");
This works fine. But thing is i am getting session value in CGI.pm and printing that, which is not working properly when i redirect. so i am searching for another method to redirect from CGI. any one who knows that, can help me.. Thanks new user

Updated Steve_p - added code tags

Replies are listed 'Best First'.
Re: Redirection in mod_perl+CGI
by drfrog (Deacon) on Nov 30, 2004 at 17:15 UTC
    why not use mod_perl's redirection methods? put this in a mod_perl module and load this handler
    sub handler { my $r = shift; $r->headers_out->set(Location => "http://www.foo.bar"); }
    more examples here mod_perl code snippets
Re: Redirection in mod_perl+CGI
by fglock (Vicar) on Nov 30, 2004 at 11:50 UTC

    How about:

    $q->redirect("somepage?session=$session");
      No i doesnt help me i need am using separate function to collect the session values so i need some redirect functions in CGI Is thr any
        store the session id in a (soonish expiring) cookie that the re-directed page can read.
        the hardest line to type correctly is: stty erase ^H