In our case we needed to persist the cookie jar inside the session.
class SessionCookieJar extends Jar
public function __construct(Session $session)
$this->session = $session;
public function setCookies($cookies)
public function getCookies()
return $this->session->get('buzz_authentication_cookies', array());
refactored cookie jar to make it easier to store the cookie jar elsew…
…here (like in a session)
Can you say more about this case? If swapping out the storage mechanism is a legit use case I would like to also look at other implementation options.
we are storing the cookies to send in requests inside the session
Thanks, Captain Obvious… In your opinion, should we create a storage interface and inject that into the cookie jar? Designing for inheritance doesn't seem right here.
dunno ... i don't think that many people will need to do something like this .. but this didn't feel like all that bad to do with inheritance and the changes are not all that drastic.
of course for example for sessions in Symfony2 core we have this separation, but it seems a bit like overkill for this use case.