Mailing List Archive

Dynamically setting Domain during authentication while using Apache2::AuthCookieDBI
I need an auth cookie to be valid across all subdomains I have, so it
makes sense to set the cookie domain to .domain.com

However setting that in the Apache config via:

PerlSetVar MyDomain .domain.com

Isn't what I need since I want to be able to use:

domain2.com domain3.com etc depending on which domain $r->hostname returns.

I'm using Domain::PublicSuffix to accurately determine the suffix (root)
domain so all good there.

My first attempt was to subclass Apache2::AuthCookieDBI and override one
of the first functions with a call to $r->dir_config, like this:

my $auth_name = $r->auth_name;
my $hostname = $r->hostname;
... stuff with domain name ...
$r->dir_config("$auth_nameDomain", $suffix);

But it seems I am missing some way things work since uh... I'm still
getting www.domain.com for my cookie domain.

Am I doing it all wrong? Over-complicating? Is there an easier way to
do this?

Thanks for any guidance!

Tosh

--
McIntosh Cooey - Twelve Hundred Group LLC - http://www.1200group.com/