File: logout.pl

package info (click to toggle)
libapache-authcookie-perl 3.06-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 256 kB
  • ctags: 16
  • sloc: perl: 157; makefile: 52
file content (29 lines) | stat: -rwxr-xr-x 563 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use strict;

use mod_perl;
use constant MODPERL2 => ($mod_perl::VERSION >= 1.99);

if (MODPERL2) {
    require Apache::Access;
}

my $r = Apache->request;
my $auth_type = $r->auth_type;

# Delete the cookie, etc.
$auth_type->logout($r);
$r->content_type("text/html");
$r->status(200);
unless (MODPERL2) {
    $r->send_http_header;
}

print <<EOF;
<HTML>
<HEAD><TITLE>Logged Out</TITLE></HEAD>
<BODY>
<P>You have been logged out and the cookie deleted from you browser.</P>
<P><A HREF="protected/get_me.html">Go ahead and try it again.</A></P>
</BODY>
</HTML>
EOF