,
time_zone => 'GMT',
);
$dt->set_formatter( $fmt );
return( $dt );
}
sub TO_JSON
{
my $self = shift( @_ );
my $fields = $self->fields;
my $ref = {};
foreach my $m
e string.
=head2 TO_JSON
This method is used so that if the cookie object is part of some data encoded into json, this will convert the cookie data properly to be used by L<JSON>
=head1 SIGNED COOK
ire APR::Request::Cookie;
}
use Cookie;
use Cookie::Domain;
use DateTime;
use JSON;
use Module::Generic::HeaderValue;
use Scalar::Util;
use URI::Escape ();
our $VER
->{secret} = undef;
# Cookie file type; can also be 'lwp' or 'netscape'
$self->{type} = 'json';
$self->{_init_strict_use_sub} = 1;
$self->SUPER::init( @_ );
$self->{request} = $re
json => \&load,
lwp => \&load_as_lwp,
netscape => \&load_as_netscape,
};
return( $self->error( "Unknown cookie jar type '$type'. This can be either json, lwp o
teTime;
use DateTime::Format::Strptime;
use Module::Generic::File qw( tempfile );
use JSON;
use Net::IDN::Encode ();
use Wanted;
use constant URL => 'https://publicsuffix.org/l
{file} = $base->child( 'public_suffix_list.txt' );
$self->{json_file} = Module::Generic::File->sys_tmpdir->child( 'public_suffix.json' );
$self->{meta} = {};
$self->{min_suffix} = 0;
$
have one now
if( $dont_have_etag && $meta->{etag} )
{
$self->save_as_json || return( $self->pass_error );
}
return( $self );
}
elsif( $code ne 200
Save cookies repository as json
$jar->save( '/some/where/mycookies.json' ) || die( $jar->error );
# Load cookies into jar
$jar->load( '/some/where/mycookies.json' ) || die( $jar->error );
# Save encrypted
$jar->save( '/some/where/mycookies.json',
{
encrypt => 1,
key => $key,
iv => $iv,
algo => 'AES',
}) || die( $jar->error );
# Load
cookies from encrypted file
$jar->load( '/some/where/mycookies.json',
{
decrypt => 1,
key => $key,
iv => $iv,
algo => 'AES'
}) || die( $jar->error );