[Catalyst] cookies!

Jennifer Ahn jenahn at stanford.edu
Wed Feb 13 01:40:08 GMT 2008


How did you instantiate the cookie in the beginning of the session?



Toby Corkindale wrote:
> On Tue, Feb 12, 2008 at 03:44:44PM -0800, Jennifer Ahn wrote:
>   
>> hello!
>>
>> how does one implement cookies in catalyst?
>>
>> jennifer
>>     
>
> You can access the cookie jar with:
> $c->request->cookie('myCookie');
> or
> $c->request->cookies->{'myCookie'}->value;
>
> To set cookies, use $c->response instead, like:
> $c->response->cookies->{'newCookie'} = {
>     value => '123',
>     path => '/',
>     domain => 'foobar.com',
>     expires => '+8h',
>     };
>
> Toby
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
>   



More information about the Catalyst mailing list