We decided to turn off our confirmation page and doing that broke some
WAS tracking cookies that was implemented in javascript in that page.

It would be nice to be able to still set configurable cookies from
WebLogin variables in print_confirmation_page when BYPASS_CONFIRM is set.

I've worked up a first approach to do that which is less generic and
more targeted to our particular need. Would this be acceptable? Would a
more generic approach be desired? Any suggestions? Thanks for your time.

diff --git a/etc/webkdc/webkdc.conf b/etc/webkdc/webkdc.conf
index 0f609a8..246a958 100644
--- a/etc/webkdc/webkdc.conf
+++ b/etc/webkdc/webkdc.conf
@@ -20,6 +20,8 @@ $REMEMBER_FALLBACK = "yes";

 $BYPASS_CONFIRM = 1;

+$PER_WAS_LOGOUT_COOKIE = 1;
+
 # Convert all usernames submitted at WebLogin to lowercase:
 sub map_username {
     my ($username) = @_;
diff --git a/usr/local/lib64/perl5/WebLogin.pm
b/usr/local/lib64/perl5/WebLogin.pm
index 20f78bb..850ec73 100644
--- a/usr/local/lib64/perl5/WebLogin.pm
+++ b/usr/local/lib64/perl5/WebLogin.pm
@@ -415,6 +415,12 @@ sub print_headers {
                                   -value    => $value,
                                   -secure   => $secure,
                                   -httponly => 1);
+
+        # Per WAS cookie to track for single logout capabilities
+        } elsif ($name =~ /^wa_logout/) {
+            $cookie = $q->cookie (-name     => $name,
+                                  -value    => $value,
+                                  -secure   => $secure);
         }

         # Add the cookie to the list of cookies we're setting if we
created a
@@ -855,6 +861,15 @@ sub print_confirm_page {
         }
     }

+    if ($WebKDC::Config::PER_WAS_LOGOUT_COOKIE) {
+        my $pretty_url = $self->pretty_return_uri(URI->new
($resp->return_url));
+        my $was_logout_cookie_name = "wa_logout_$pretty_url";
+        $resp->cookies->{$was_logout_cookie_name} = CGI::Cookie->new(
+            -name => $was_logout_cookie_name,
+            -value => 'true',
+        );
+    }
+
     # Print out the page, including any updated proxy cookies if
needed.  If
     # we're suppressing the confirm page and the browser used HTTP/1.1, use
     # the HTTP 303 redirect code as well.

Reply via email to