in reply to undef-ing $ENV{'REMOTE_USER'} from within Perl?
print $q->header ( -status => 401 );When they run the script again, you should redirect them using $q->redirect() to the main page.
use strict; use CGI; my $q = new CGI; my $lock_dir = "/tmp/lock"; my $other_url = my ($sess) = $q->param{sess} =~ /^(\d+)/; if (-f "$lock_dir/$sess.logout") { # Check for stale lock files here, too, # such as all those over 1 day old. # Remove this particular lock file unlink ("$lock_dir/$sess.logout"); print $q->redirect ($q->param{page}); } else { # Create a zero byte lock file for this session open (LOCK, ">$lock_dir/$sess.logout"); close (LOCK); # Return a refused message which causes the # browser to prompt for authentication. print $q->header ( -status => 401 ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: undef-ing $ENV{'REMOTE_USER'} from within Perl?
by hibernian (Acolyte) on Jul 12, 2001 at 12:47 UTC |