[Catalyst] hostname

Octavian Rasnita orasnita at gmail.com
Fri Jan 11 11:45:55 GMT 2008


From: "Carl Johnstone" <catalyst at fadetoblack.me.uk>

>> cookie_domain => the_host()
>> in the MyApp config, but when I try to start the server it gives an error 
>> telling that I can't use the method "req" because $c is undefined.
>
> I'd be curious about why you wanted the cookie domain in the config 
> anyway!
>
> I presume you've got a bit of code like:
>
> $c->response->cookies->{'foo'} = { domain => 
> $c->config('cookie_domain') };
>
> In which case why couldn't you just do
>
> $c->response->cookies->{'foo'} = { domain => $c->req->hostname };
>

I needed the domain name for setting the session in MyApp.pm.

Octavian




More information about the Catalyst mailing list