Skip Menu |

This queue is for tickets about the HTTP-Cookies CPAN distribution.

Report information
The Basics
Id: 85011
Status: resolved
Priority: 0/
Queue: HTTP-Cookies

People
Owner: Nobody in particular
Requestors: lxp [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 6.01
Fixed in: (no value)



Subject: allow different "ignore_discard" value at save() time
In HTTP::Cookies v6.01, the "save" method only saves "Discard" cookies if the "ignore_discard" attribute was set to a true value at object construction. If that did not occur, then currently there is no way to cause "Discard" cookies to be written to file without breaking object encapsulation. This is a problem when code wishing to save the complete contents of a cookie jar does not have control over its creation. Please consider adding either: 1. an "ignore_discard" method to allow altering of this attribute after construction; or 2. a second, optional argument to the "save" method which allows overriding of the object-based "ignore_discard" attribute: $cookie_jar->save( $file, $ignore_discard )
On Fri May 03 15:45:55 2013, LXP wrote: Show quoted text
> Please consider adding either: > > 1. an "ignore_discard" method to allow altering of this attribute after > construction; or > > 2. a second, optional argument to the "save" method which allows > overriding of the object-based "ignore_discard" attribute: > > $cookie_jar->save( $file, $ignore_discard )
After further thought, I think I would personally prefer option #2 since it doesn't alter object state (and therefore won't cause unintended side effects no possible later calls to "save"). Both options are backwards-compatible with the current API, however.
On Fri May 03 15:54:33 2013, LXP wrote: Show quoted text
> After further thought, I think I would personally prefer option #2 since > it doesn't alter object state (and therefore won't cause unintended side > effects no possible later calls to "save").
...effects on* possible later calls to "save."
A test and patch for this functionality (implemented as an additional save() argument) is available here: https://github.com/gisle/http-cookies/pull/2