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

I have a Perl action page that works but cant seem to get the redirect to work if someone refreshes the page. If someone copies the URL address of the Perl action page and puts it in another browser address window it does redirect the page.

Please advise how I can make the perl action page redirect on refresh? My attempt:
# $subject variable is coming from the form page my $site_url = 'http://myurl/index.pl'; my $thequery = new CGI; unless(defined($subject)) { print $thequery -> redirect($site_url); exit(0); }

Replies are listed 'Best First'.
Re: Redirect on refresh
by InfiniteSilence (Curate) on Mar 02, 2006 at 18:46 UTC
    I would store a unique value (SDBM?) on the server and use CGI::Cookie for the client. Create a unique value and store it on the server and send it to the user. If you get that value back (by reading in the cookie) you can delete the server-side unique value, redirect that user, and repeat the process all over again.

    Celebrate Intellectual Diversity