Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Allow replacement of cookie implementation #22

Merged
merged 1 commit into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Classes/Middleware/CookieSessionMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
use Psr\Http\Server\RequestHandlerInterface;
use Symfony\Component\HttpFoundation\Cookie;
use TYPO3\CMS\Core\Http\NormalizedParams;
use WerkraumMedia\Watchlist\Session\CookieSessionService;
use WerkraumMedia\Watchlist\Session\CookieSessionInterface;

class CookieSessionMiddleware implements MiddlewareInterface
{
private CookieSessionService $cookieSession;
private CookieSessionInterface $cookieSession;

public function __construct(
CookieSessionService $cookieSession
CookieSessionInterface $cookieSession
) {
$this->cookieSession = $cookieSession;
}
Expand Down
10 changes: 10 additions & 0 deletions Classes/Session/CookieSessionInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace WerkraumMedia\Watchlist\Session;

interface CookieSessionInterface
{
public function getCookieName(): string;

public function getCookieValue(): string;
}
2 changes: 1 addition & 1 deletion Classes/Session/CookieSessionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
use WerkraumMedia\Watchlist\Domain\Model\Item;
use WerkraumMedia\Watchlist\Domain\Model\Watchlist;

class CookieSessionService implements SessionServiceInterface
class CookieSessionService implements CookieSessionInterface, SessionServiceInterface
{
private PropertyMapper $propertyMapper;

Expand Down
8 changes: 8 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@ The content element is not necessary.
Changelog
=========

v1.1.0
------

* Allow replacement of cookie implementation.
The implementation is now extracted into an interface.
That way it is easier to replace the concrete implementation for cookie handling
with a custom one.

v1.0.1
------

Expand Down