#!/usr/bin/perl # # logout.cgi -- CGI script to logout the user. # Actually this script will send out "401 Authorization Required" # message to ask user login again. For Netscape it will clear # last login user ID. # # # Date : 04 January 1999 # Simon Tneoh Chee-Boon tneohcb@pc.jaring.my # # Copyright (c) 1998 Simon Tneoh Chee-Boon. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # use strict; my($time); print "Status: 401 Authorization Required\n"; print "WWW-Authenticate: Basic realm=\"HTTPPassword Demo\"\n"; $time = time; print "Set-Cookie: logout=$time\n"; print "Content-Type: text/html\n\n"; print <<__END__HTML__; Logout

Authorization Required

Back To Demo
This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.

Now try to click here to go to protected directory again.

View Source


__END__HTML__