Masatoshi Mizuno > Egg-Release-3.14 > Egg::Response::TieCookie

Download:
Egg-Release-3.14.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 3.00   Source  

NAME ^

Egg::Response::TieCookie? - A class that preserves set Cookie.

SYNOPSIS ^

  $e->cookies->{hoge}= 'boo';
  
  $e->cookies->{hoge}= {
    value   => 'boo',
    path    => '/home',
    domain  => 'mydomain',
    expires => '+1d',
    secure  => 1,
    };

DESCRIPTION ^

It is a class returned by the cookies method of Egg::Response.

Information to generate the Set-Cookie header is preserved.

The set value is Egg::Response::FetchCookie of the HASH reference base. It is an object.

The key shown in name, value, and the configuration is used to refer to the set value.

  my $cookies= $e->response->cookies;
  
  $cookies->name    or $cookies->{name}   # cookie ̾¤Î»²¾È
  $cookies->value   or $cookies->{value}  # ÀßÄêÃͤλ²¾È
  $cookies->path    or $cookies->{path}
  $cookies->domain  or $cookies->{domain}
  $cookies->expires or $cookies->{expires}
  $cookies->secure  or $cookies->{secure}

CONFIGURATION ^

Cookie_default of the configuration of the project is assumed to be a default value.

  cookie_default=> {
    path    => '/',
    domain  => 'mydomain',
    expires => '+1M',
    secure  => 1,
    },

path

It is passing that enables the reference to Cookie.

domain

It is a domain that enables the reference to Cookie.

expires

It is validity term of Cookie. It specifies it by the form that expires of CGI::Util accepts.

  expires => '+1m'    # 1 minute
  expires => '+1h'    # 1 hour
  expires => '+1d'    # 1 day
  expires => '+1M'    # 1 month
  expires => '+1y'    # 1 year

Please note the desire that there is a thing not accepted either when lengthening it too much by the specification of Cookie. Cookie comes always to be annulled because past time will be given when giving it by the minus.

secure

It makes it to Cookie with the secure flag.

However, if it is a usual access in SSL without, this setting is disregarded. When Cookie is issued only when it is accessed with SSL, it is necessary to process it on own code side.

SEE ALSO ^

Egg::Release, Egg::Response, Tie::Hash,

AUTHOR ^

Masatoshi Mizuno <lushe@cpan.org>

COPYRIGHT AND LICENSE ^

Copyright (C) 2008 Bee Flag, Corp. <http://egg.bomcity.com/>.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: