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

Hi monks,
I am using the following code snippet for automatica redirection.
print $cgi->redirect(-url=>"http://localhost/cgi-bin/main.cgi?username +=$username&loggedin=1");

I just want to pass the parameters hidden just like post method. Please tell me how to do that.
Thanks

Replies are listed 'Best First'.
Re: url redirect with parameters hidden
by moritz (Cardinal) on Jan 16, 2008 at 06:24 UTC
    As chromatic pointed out that's not supported in http, and even it were, it wouldn't be secure.

    What you probably need is cookies and session management.

Re: url redirect with parameters hidden
by chromatic (Archbishop) on Jan 16, 2008 at 05:49 UTC

    As far as I know, HTTP doesn't work that way.

Re: url redirect with parameters hidden
by olus (Curate) on Jan 16, 2008 at 11:45 UTC
    You could encrypt the GET parameters and decrypt them on the target script.
    Something like
    use Crypt::CBC; use MIME::Base64; my $key = '...'; my $crypt = ..... #construct my $params = "username=$username&loggedin=1"; $params = cipher->encrypt($params); $params = encode_base64($params); $params = unpack("H64", $params); print $cgi->redirect(-url=>"http://localhost/cgi-bin/main.cgi?params=$ +params");
    Now, on the main.cgi you must parse the params
    use Crypt::CBC; use MIME::Base64; my $key = '...'; my $crypt = ..... #construct $params = pack("H64", $params); $params = decode_base64($params); $params = $cipher->decrypt($params); # now split $params in order to get username and loggedin