Redirect on refresh
Anonymous Monk
created: 2006-03-02 12:49:51
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);
}
Re: Redirect on refresh
created: 2006-03-02 13:46:52
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

perlmonks.org content © perlmonks.org and Anonymous Monk, InfiniteSilence

prlmnks.org © 2006 edmund von der burg (eccles & toad)

v 0.03