added on local at 2026-06-21 23:13:52
| 1 | #!/usr/bin/perl | |
| 2 | use strict; | |
| 3 | use warnings; | |
| 4 | use lib '/var/www/vhosts/3dshawn.com/admin.3dshawn.com'; | |
| 5 | use MODS::Login; | |
| 6 | ||
| 7 | my $auth = MODS::Login->new; | |
| 8 | # Pull the session cookie value, kill the row in DB, clear the cookie. | |
| 9 | my $raw = $ENV{HTTP_COOKIE} || ''; | |
| 10 | my $sid; | |
| 11 | foreach my $pair (split /;\s*/, $raw) { | |
| 12 | my ($k, $v) = split /=/, $pair, 2; | |
| 13 | next unless defined $k && defined $v; | |
| 14 | $k =~ s/^\s+|\s+$//g; | |
| 15 | $sid = $v if $k eq 'meta_session'; | |
| 16 | } | |
| 17 | $auth->sign_out($sid) if $sid; | |
| 18 | ||
| 19 | print $auth->clear_cookie_header . "\n"; | |
| 20 | print "Status: 302 Found\nLocation: /login.cgi\n\n"; |