Diff -- /var/www/vhosts/3dshawn.com/admin.3dshawn.com/logout.cgi
Diff

/var/www/vhosts/3dshawn.com/admin.3dshawn.com/logout.cgi

added on local at 2026-06-21 23:13:52

Added
+20
lines
Removed
-0
lines
Context
0
unchanged
Blobs
from
to 35baae3b6dd4
Restore this content →
Unified diff
Naive LCS-based line diff. Additions in emerald, deletions in rose. Both sides decompressed live from BLOB_STORE.
1#!/usr/bin/perl
2use strict;
3use warnings;
4use lib '/var/www/vhosts/3dshawn.com/admin.3dshawn.com';
5use MODS::Login;
6
7my $auth = MODS::Login->new;
8# Pull the session cookie value, kill the row in DB, clear the cookie.
9my $raw = $ENV{HTTP_COOKIE} || '';
10my $sid;
11foreach 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
19print $auth->clear_cookie_header . "\n";
20print "Status: 302 Found\nLocation: /login.cgi\n\n";
Keyboard: j next diff k previous diff g top G bottom r restore c compile-check ? help