X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/711e9f664d747034090f834acce9f5bc86f99e99..e24a09c638a103745a9b7b7e557d3222de2d1275:/writer.plp diff --git a/writer.plp b/writer.plp index 256a074..84dc4a8 100644 --- a/writer.plp +++ b/writer.plp @@ -18,6 +18,7 @@ my $db = eval { } or Abort('Database error', 501, $@); my $user = eval { + my $rootpath = ($ENV{REQUEST_URI} // '/writer') =~ s{(?new( -name => 'login', -value => '', - -path => '/writer', + -path => $rootpath, -expires => 'now', )->as_string)) { delete $cookie{login}; @@ -46,7 +47,7 @@ my $user = eval { my $httpcookie = CGI::Cookie->new( -name => 'login', -value => join(':', @{$found}{qw( username pass )}), - -path => '/writer', + -path => $rootpath, ) or die "prepared object is empty\n"; AddCookie($httpcookie->as_string); } or Abort(["Unable to create login cookie", $@], 403);