PerlSetVar OILSWebWebDir "/openils/var/web"
PerlSetVar OILSWebDefaultTemplateExtension "tt2"
+ # An optional domain-level cookie "shared_ses" which will contain the
+ # evergreen auth token in addition to the standard "ses" cookie
+ #PerlSetVar OILSWebSharedSesCookieDomain "example.org"
+
# Enable Template-Toolkit error debugging messages (apache error log)
PerlSetVar OILSWebDebugTemplate "true"
)
];
- if (defined($ENV{shared_ses_domain} && $self->apache->hostname =~ /$ENV{shares_ses_domain}/)) {
- push @$cookies,
- # an optional domain-shared copy of the auth token, useful for
- # some SSO-like environments
- $cgi->cookie(
- -name => COOKIE_SHARED_SES,
- -path => '/',
- -domain => $ENV{shared_ses_domain},
- -secure => 1,
- -value => $response->{payload}->{authtoken},
- -expires => $login_cookie_expires
- );
+ if (defined($self->apache->dir_config('OILSWebSharedSesCookieDomain'))) {
+ my $shared_ses_domain = $self->apache->dir_config('OILSWebSharedSesCookieDomain');
+ my $shared_ses_domain_regex = '\.' . $shared_ses_domain . '$';
+
+ if ($self->apache->hostname =~ /$shared_ses_domain_regex/ {
+ push @$cookies,
+ # an optional domain-shared copy of the auth token, useful for
+ # some SSO-like environments
+ $cgi->cookie(
+ -name => COOKIE_SHARED_SES,
+ -path => '/',
+ -domain => $shared_ses_domain,
+ -secure => 1,
+ -value => $response->{payload}->{authtoken},
+ -expires => $login_cookie_expires
+ );
+ }
}
return $self->generic_redirect(