in reply to HTTP::Cookies::Chrome fails with Chrome cookies
my $sth = $dbh->prepare( 'SELECT creation_utc,host_key,name,value, +path,expires_utc,is_secure,is_httponly,last_access_utc,has_expires,is +_persistent,priority,encrypted_value,samesite,source_scheme,source_po +rt FROM cookies' );
Folks-
Upon further investigation, it seems that the Chrome.pm file is not up-to-date with the latest version of how Chrome stores its cookies. Specifically in the _get_rows function:
sub _get_rows { my( $self, $file ) = @_; my $dbh = $self->_connect( $file ); my $sth = $dbh->prepare( 'SELECT * FROM cookies' ); # CHANGE THIS + LINE $sth->execute; my @rows = map { if( my $e = $_->encrypted_value ) { my $p = $self->_decrypt( $e ); $_->decrypted_value( $self->_decrypt( $e ) ); } $_; } map { HTTP::Cookies::Chrome::Record->new( $_ ) } @{ $sth->fetchall_arrayref }; $dbh->disconnect; \@rows; }
The fetchall_arrayref list that is returned needs to match the %columns hash in HTTP::Cookies::Chrome::Record.
Adding some debug printing statements to Chrome.pm, I see the following - which do not seem to be aligning:my %columns = map { state $n = 0; $_, $n++ } qw( creation_utc host_key name value path expires_utc is_secure is_httponly last_access_utc has_expires is_persistent priority encrypted_value samesite source_scheme source_port is_same_party decrypted_value );
creation_utc=13394990094757976 host_key=www.costco.com name= value=CriteoSessionUserId path= expires_utc=v10?a@uV?0^t?,h????????... is_secure=/ is_httponly=13397582094000000 last_access_utc=0 has_expires=0 is_persistent=13395156037532475 priority=1 encrypted_value=1 samesite=1 source_scheme=-1 source_port=2 is_same_party=443 decrypted_value=13394990094757976
|
---|